Add Create a Course link in Instructor’s Left Member menu

Add this code in child theme functions.php or WPLMS customizer -> wplms_customizer.php

PHP Code:
add_action( 'bp_setup_nav', 'create_course_setup_nav');
 
function create_course_setup_nav(){
       global $bp;
$check =0;
      if(bp_is_my_profile() && current_user_can('edit_posts')){
        $check =1;
        bp_core_new_nav_item( array(
            'name' => __('Create a Course', 'Vibe' ),
            'slug' => 'create-course',
            'position' => 100,
            'screen_function' => 'wplms_create_course_redirect',
            'show_for_displayed_user' => $check
          ) );
        }
}
 
function wplms_create_course_redirect(){
   $course_create = vibe_get_option('create_course');
   if(is_numeric($course_create)){
      wp_redirect(get_permalink($course_create),'301');
      exit;
   }
}