Adding custom field in course setting

To add field in back end course edit  :

Please add this code in your wplms-customizer.php file in wplms customizer plugin :

add_filter('wplms_course_metabox','custom_fileds');

function custom_fileds($field1){
           $prefix = 'vibe_';
           $field1[]=array( // Text Input
           'label' => __('Custom item menu','vibe-customtypes'), // <label>
           'desc'  => __('Put description','vibe-customtypes'), // description
           'id'    => $prefix.'field1', // field id and name
           'type'  => 'text' // type of field
                               );
           return $field1;
           
       }

 

To edit field in front end course creation edit :.

add_filter('wplms_course_creation_tabs','add_in_front_end');
 
function add_in_front_end($settings){
            
                
    $fields = $settings['course_settings']['fields'];
    $arr=array(array(
                'label' => __('custom','wplms-front-end'), // <label>
                'desc'  => __('custom','wplms-front-end'), 
                'text'=>__('custom','wplms-front-end' ),// description
                'id'  => 'vibe_custom', // field id and name
                'type'  => 'text', // type of field
                'from'=>'meta'
                ));

    array_splice($fields, (count($fields)-1), 0,$arr );
    $settings['course_settings']['fields'] = $fields;  

  return $settings;
}

 

Leave a Reply

Your email address will not be published. Required fields are marked *