Home › Forums › Legacy Support › Support queries › How-to & Troubleshooting › Custom field in create course section saving issue
Tagged: create course, custom field
- This topic has 3 replies, 2 voices, and was last updated 5 years, 10 months ago by logan.
Viewing 4 posts - 1 through 4 (of 4 total)
-
AuthorPosts
-
January 15, 2019 at 3:59 pm #192592gsjaakSpectatorHi! I have writen some code to get a few custom fields in the front end create course section. I want to insert them in the first panel (create course). The fields get displayed, however for some reason they do not save their information. Even stranger thing: when I place the field in the settings panel (by changing [create_course] to [course_settings]), the fields do save. It does not make sense though to have them there, how can I make this work? Here is the code: add_filter('wplms_course_creation_tabs','add_in_front_end'); function add_in_front_end($settings){ $fields = $settings['create_course']['fields']; $arr=array(array( 'label' => __('label','wplms-front-end'), 'desc' => __('desc','wplms-front-end'), 'text'=>__('Kenmerk 1:','wplms-front-end' ),/ 'id' => 'vibe_usp1', 'type' => 'text', ), array( 'text'=>__('Kenmerk 2:','wplms-front-end' ), 'id' => 'vibe_usp2', 'type' => 'text', ), array( 'text'=>__('Kenmerk 3:','wplms-front-end' ),/ 'id' => 'vibe_usp3', 'type' => 'text', ), array( 'text'=>__('Kenmerk 4:','wplms-front-end' ), 'id' => 'vibe_usp4', 'type' => 'text', ), ); array_splice( $settings['create_course']['fields'],2, 0, $arr ); return $settings; } add_filter('wplms_course_metabox','custom_fileds'); add_filter('wplms_course_metabox','custom_fileds2'); add_filter('wplms_course_metabox','custom_fileds3'); add_filter('wplms_course_metabox','custom_fileds4'); function custom_fileds($usp1){ $prefix = 'vibe_'; $usp1[]=array( 'label' => __('Custom item menu','vibe-customtypes'), 'desc' => __('Put description','vibe-customtypes'), 'id' => $prefix.'usp1', 'type' => 'text' ); return $usp1; } function custom_fileds2($usp2){ $prefix = 'vibe_'; $usp2[]=array( // Text Input 'label' => __('Custom item menu','vibe-customtypes'), 'desc' => __('Put description','vibe-customtypes'), 'id' => $prefix.'usp2', 'type' => 'text' ); return $usp2; } function custom_fileds3($usp3){ $prefix = 'vibe_'; $usp3[]=array( // Text Input 'label' => __('Custom item menu','vibe-customtypes'), 'desc' => __('Put description','vibe-customtypes'), 'id' => $prefix.'usp3', 'type' => 'text' ); return $usp3; } function custom_fileds4($usp4){ $prefix = 'vibe_'; $usp4[]=array( 'label' => __('Custom item menu','vibe-customtypes'), 'desc' => __('Put description','vibe-customtypes'), 'id' => $prefix.'usp4', 'type' => 'text' ); return $usp4; }January 16, 2019 at 12:58 pm #192717loganMemberMy apologies. this is not possible in course section. you have to put it in setting only then data will be saved.January 16, 2019 at 2:43 pm #192732gsjaakSpectatorAh too bad, thanks for getting backJanuary 17, 2019 at 7:37 am #192800loganMemberthanks for confirming. closing this topic.
-
AuthorPosts
Viewing 4 posts - 1 through 4 (of 4 total)
- The topic ‘Custom field in create course section saving issue’ is closed to new replies.