Button only for instructors in their profile page

Home Forums Legacy Support Support queries How-to & Troubleshooting Button only for instructors in their profile page

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #43008
    mind_expert
    Spectator
    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.
    #43155
    H.K. Latiyan
    Participant
    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.
    #43180
    mind_expert
    Spectator
    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.
Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Button only for instructors in their profile page’ is closed to new replies.