Custom field radio button

Home Forums Legacy Support Support queries Setup issues Custom field radio button

Tagged: 

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #87015
    arina
    Spectator
    1) Hi, when I add a custom field, it will automatically set to text field. How do I change the type to radio button & where can I add the field for the radio button? 2) The custom field only appears in admin front end. How can I enable it in instructor front end?
    #87152
    Anshuman Sahu
    Keymaster
    Please follow this tip to add custom field in course : https://wplms.io/support/knowledge-base/adding-custom-field-in-course-setting/ This is an example to add a text field named custom in course settings similarly you can add radio field like this  : 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' => 'yesno', // type of field        'options' => array(          array('value' => 'H',                'label' =>__('Hide','vibe-customtypes')),          array('value' => 'S',                'label' =>__('Show','vibe-customtypes')),        ),        'std'   => 'H'                                );            return $field1;                    } To add custom fields in assignment,course,product,page,post just change this line :  add_filter('wplms_course_metabox','custom_fields'); change thecourse " to post,page,wplms-assignment,product etc .
    #87154
    Anshuman Sahu
    Keymaster
    2. for front there is a different filter . Try adding this code for adding custom fields in front end course edit : add_filter('wplms_course_creation_tabs','switch_wplms_front_end_tabs12',1); function switch_wplms_front_end_tabs12($settings){   $fields = $settings['course_settings']['fields'];     $arr=array(array(                   'label'=> __('custom','wplms-front-end' ),                   'text'=>__('custom','wplms-front-end' ),                   'type'=> 'switch',                   'options'  => array('H'=>__('NO','wplms-front-end' ),'S'=>__('YES','wplms-front-end' )),                   'style'=>'',                   'id' => 'vibe_custom',                   'from'=> 'meta',                   'default'=>'H',                   'desc'=> __('custom','wplms-front-end' )                   ));              array_splice($fields, (count($fields)-1), 0,$arr );              $settings['course_settings']['fields'] = $fields;     return $settings;   }
Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Custom field radio button’ is closed to new replies.