How to add a custom html/textarea meta data to a course?

Home Forums Legacy Support Support queries How-to & Troubleshooting How to add a custom html/textarea meta data to a course?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #152116
    morgan
    Spectator
    Hello, In your doc, you indicate how to add custom info in course details, doing the following: function wplms_custom_course_details_repeatable($metabox){ $metabox['vibe_course_details'] = array( 'label' => __('Custom Course details','vibe-customtypes'), // 'desc'  => __('custom course details.','vibe-customtypes'), // description 'id'    => 'vibe_course_details', // field id and name 'type'  => 'repeatable', // type of field 'std'   => '' ); return $metabox; } I personally need to add large text formatted in html and the small text box doesnt allow to do this efficiently, could you please indicate the other available types of information (textArea?) available to add custom meta data to the courses? Thanks in advance!
    #152175
    Diana
    Participant
    @morgan, Please paste this code in wp-admin > Plugins > Editor > Select WPLMS Customizer Plugin > wplms-customizer.php You'll get a custom course detail section when you edit the course in the backend. Put some description there and then save. This will be visible in the course detail sidebar add_filter('wplms_course_metabox','wplms_custom_course_details_repeatable'); function wplms_custom_course_details_repeatable($metabox){ $metabox['vibe_course_details'] = array( 'label' => __('Custom Course details','vibe-customtypes'), // <label> 'desc'  => __('custom course details.','vibe-customtypes'), // description 'id'    => 'vibe_course_details', // field id and name 'type'  => 'textarea', // type of field 'std'   => '' ); return $metabox; }   add_filter('wplms_course_details_widget','wplms_custom_course_details_information',9999999); function wplms_custom_course_details_information($details){ $custom_info = get_post_meta(get_the_ID(),'vibe_course_details',true); if(isset($custom_info)){ $details[]='<li>'.htmlspecialchars_decode($custom_info).'</li>'; } return $details; } Refer: http://prntscr.com/j0l2p5
Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘How to add a custom html/textarea meta data to a course?’ is closed to new replies.