How may I insert a button that only instructors can see and interact with it to go to another private page with their name on a $_POST?
No students shall see the button.
If you just want to show the link of the page to instructors only in menu, then there is a setting in the LMS->settings->enable instructor menu, then you can show custom link(of your page) in the instructors only menu.
Or if you want to show button in instructors profile only with a form, then use this code in the wplms-customizer.php file present in your wplms customizer plugin.
add_action('bp_before_member_body','custom_function');
function custom_function(){
if(is_user_logged_in() && user_can(bp_displayed_user_id(),'edit_posts')){
$username=get_user_by('ID',bp_displayed_user_id());
echo '<form method="post">
<input type="submit" value="'.$username->user_login.'" name="instructor">
</form>';
}
}
NOTE: This is just an example how your code should be and you can customize it according to your requirements.
Thank you so much!
I ended up using LMS->settings->enable instructor menu, because before reading the page I've created a page that uses the instructor's name, that is logged in, to search in the database.