LearnPress / learnpress

LearnPress WordPress LMS Plugin by ThimPress
https://thimpress.com/learnpress
239 stars 140 forks source link

HOW CAN I ADD NEW TAB along with text field #349

Closed AlfieTitu78 closed 2 years ago

AlfieTitu78 commented 5 years ago

Hello @tutv @kenek195

I wish to add 02 new tabs along with text fields to enter data relatively. I want 2 new tabs "Entry Requirements" and "Progression Degrees". I have added already created 2 fields in the customisation section for these. but I cannot add tabs along with text field in the back-end in order to insert data.

I would be grateful if anyone can help in this.

Thank you in advance.

tunnhn commented 5 years ago

I am not sure where you want to add new tabs. I guess it is in admin course so you can do it by following instruction:

` add_filter( 'learn-press/admin-course-tabs', function ($tabs) { $tabs['my-tab'] = new RW_Meta_Box(array( 'id' => 'my_tab_id', 'title' => ( 'My Tab', 'learnpress' ), 'pages' => array( LP_COURSE_CPT ), 'priority' => 'high', 'icon' => 'dashicons-admin-tools', 'fields' => array( array( 'name' => ( 'My Field', 'learnpress' ), 'id' => '_my_field_id', 'type' => 'text', 'desc' => __( 'My field description', 'learnpress' ), 'std' => '' ), /// other fields ) ));

return $tabs;

}); `

And, this is what you get: http://prntscr.com/n3xvr5

AlfieTitu78 commented 5 years ago

Dear @tunnhn, Thank you for your reply.

Basically I wish to add two tabs "Entry Requirements" and "Progression Degrees" in the single-course page and these 2 tabs will be next to "Overview" and "Curriculum" tabs. For these 2 tabs I want also html text field in the wp-admin backend so that I can do text formatting if necessary. Please note that I have already created the “tab name” in the following *.PHP file: wp-content/themes/my-theme/inc/admin/customizer-sections/course-single.php

After creating these 2 tab name, it reflects in the following WP Dashboard Directory: Appearance > Customise > Courses > Single Pages

Now I want "Entry Requirements" and "Progression Degrees" to be shown in the "single-course" page, similar to this image:

TABS for Single Course

Also I want to include a text field as stated above in the wp-admin backend for each of these tabs. Here is my site: https://eoeisc.gipcl.org.uk/courses/your-complete-guide-to-photography/

I would really appreciate if you help me in this. Thank you