| 1 |
<?php |
| 2 |
/** |
| 3 |
* Settings Courses |
| 4 |
*/ |
| 5 |
$generate_course_thumbnail = get_option( 'learn_press_generate_course_thumbnail', 'no' ); |
| 6 |
$des_option_redirect_finish_course = wp_sprintf( |
| 7 |
'%s<br>%s', |
| 8 |
esc_html__( 'The site will be redirected to the URL added after clicking finish course button.', 'learnpress' ), |
| 9 |
esc_html__( 'Set blank, the site will be redirected to the single course page', 'learnpress' ) |
| 10 |
); |
| 11 |
|
| 12 |
return apply_filters( |
| 13 |
'learn-press/courses-settings-fields', |
| 14 |
array_merge( |
| 15 |
apply_filters( |
| 16 |
'learn-press/course-settings-fields/general', |
| 17 |
array( |
| 18 |
array( |
| 19 |
'title' => esc_html__( 'General', 'learnpress' ), |
| 20 |
'type' => 'title', |
| 21 |
), |
| 22 |
array( |
| 23 |
'title' => esc_html__( 'Review courses', 'learnpress' ), |
| 24 |
'desc' => esc_html__( 'Courses created by instructors will be pending in review first.', 'learnpress' ), |
| 25 |
'id' => 'required_review', |
| 26 |
'default' => 'yes', |
| 27 |
'type' => 'checkbox', |
| 28 |
), |
| 29 |
array( |
| 30 |
'title' => esc_html__( 'Auto start', 'learnpress' ), |
| 31 |
'id' => 'auto_enroll', |
| 32 |
'default' => 'yes', |
| 33 |
'type' => 'checkbox', |
| 34 |
'desc' => esc_html__( 'Students will get started courses immediately after successfully purchased.', 'learnpress' ), |
| 35 |
), |
| 36 |
array( |
| 37 |
'title' => __( 'Enable confirmation popup finish course, complete item', 'learnpress' ), |
| 38 |
'desc' => __( 'Show confirmation popup before finishing course or completing item.', 'learnpress' ), |
| 39 |
'id' => 'enable_popup_confirm_finish', |
| 40 |
'default' => 'yes', |
| 41 |
'type' => 'checkbox', |
| 42 |
), |
| 43 |
array( |
| 44 |
'title' => esc_html__( 'Archive page layout', 'learnpress' ), |
| 45 |
'desc' => esc_html__( 'Type display list course on Course Archive page', 'learnpress' ), |
| 46 |
'id' => 'archive_courses_layout', |
| 47 |
'default' => 'list', |
| 48 |
'type' => 'select', |
| 49 |
'options' => learn_press_courses_layouts(), |
| 50 |
), |
| 51 |
array( |
| 52 |
'title' => esc_html__( 'Courses per page', 'learnpress' ), |
| 53 |
'desc' => esc_html__( 'Number of courses displayed per page.', 'learnpress' ), |
| 54 |
'id' => 'archive_course_limit', |
| 55 |
'default' => '8', |
| 56 |
'type' => 'number', |
| 57 |
'custom_attributes' => array( |
| 58 |
'min' => '1', |
| 59 |
), |
| 60 |
'css' => 'min-width: 50px; width: 50px;', |
| 61 |
), |
| 62 |
array( |
| 63 |
'title' => esc_html__( 'Enable loading ajax Courses on the Course Archive page', 'learnpress' ), |
| 64 |
'desc' => __( 'On/Off <i>loading ajax Courses</i>', 'learnpress' ), |
| 65 |
'id' => 'courses_load_ajax', |
| 66 |
'default' => 'yes', |
| 67 |
'type' => 'checkbox', |
| 68 |
), |
| 69 |
array( |
| 70 |
'title' => esc_html__( 'Not run Ajax when reloading Course Archive page', 'learnpress' ), |
| 71 |
'desc' => esc_html__( 'Ajax is only applied when selecting pagination, filtering, searching and sorting. Not applicable when reloading Course Archive page.', 'learnpress' ), |
| 72 |
'id' => 'courses_first_no_ajax', |
| 73 |
'default' => 'no', |
| 74 |
'type' => 'checkbox', |
| 75 |
'show_if_checked' => 'courses_load_ajax', |
| 76 |
), |
| 77 |
array( |
| 78 |
'title' => esc_html__( 'Thumbnail dimensions', 'learnpress' ), |
| 79 |
'id' => 'course_thumbnail_dimensions', |
| 80 |
'default' => array( 500, 300, 'yes' ), |
| 81 |
'type' => 'image-dimensions', |
| 82 |
), |
| 83 |
array( |
| 84 |
'title' => esc_html__( 'Redirect when finish course', 'learnpress' ), |
| 85 |
'id' => 'course_finish_redirect', |
| 86 |
'default' => '', |
| 87 |
'type' => 'url', |
| 88 |
'placeholder' => 'https://learnpress.com/', |
| 89 |
'desc' => $des_option_redirect_finish_course, |
| 90 |
), |
| 91 |
array( |
| 92 |
'type' => 'sectionend', |
| 93 |
), |
| 94 |
) |
| 95 |
), |
| 96 |
apply_filters( |
| 97 |
'learn-press/course-settings-fields/curriculum', |
| 98 |
array( |
| 99 |
array( |
| 100 |
'type' => 'title', |
| 101 |
'title' => esc_html__( 'Curriculum Settings', 'learnpress' ), |
| 102 |
'id' => 'lp_metabox_curriculum_setting', |
| 103 |
), |
| 104 |
array( |
| 105 |
'title' => esc_html__( 'Section Per Page', 'learnpress' ), |
| 106 |
'id' => 'section_per_page', |
| 107 |
'default' => 1, |
| 108 |
'type' => 'number', |
| 109 |
'desc' => esc_html__( 'Number of sections displayed per page ( Enter -1 for display all sections).', 'learnpress' ), |
| 110 |
), |
| 111 |
array( |
| 112 |
'title' => esc_html__( 'Course Item Per Page', 'learnpress' ), |
| 113 |
'id' => 'course_item_per_page', |
| 114 |
'default' => 10, |
| 115 |
'type' => 'number', |
| 116 |
'desc' => esc_html__( 'Number of course items displayed per page in section ( Enter -1 for display all course items).', 'learnpress' ), |
| 117 |
), |
| 118 |
array( |
| 119 |
'type' => 'sectionend', |
| 120 |
'id' => 'lp_metabox_curriculum_setting', |
| 121 |
), |
| 122 |
) |
| 123 |
), |
| 124 |
apply_filters( |
| 125 |
'learn-press/course-settings-fields/single', |
| 126 |
array( |
| 127 |
array( |
| 128 |
'title' => esc_html__( 'Permalinks', 'learnpress' ), |
| 129 |
'type' => 'title', |
| 130 |
), |
| 131 |
array( |
| 132 |
'title' => esc_html__( 'Course', 'learnpress' ), |
| 133 |
'type' => 'course-permalink', |
| 134 |
'default' => '', |
| 135 |
'id' => 'course_base', |
| 136 |
), |
| 137 |
array( |
| 138 |
'title' => esc_html__( 'Lesson', 'learnpress' ), |
| 139 |
'type' => 'text', |
| 140 |
'id' => 'lesson_slug', |
| 141 |
'desc' => sprintf( 'e.g. %s/course/sample-course/<code>lessons</code>/sample-lesson/', home_url() ), |
| 142 |
'default' => 'lessons', |
| 143 |
'placeholder' => 'lesson', |
| 144 |
), |
| 145 |
array( |
| 146 |
'title' => esc_html__( 'Quiz', 'learnpress' ), |
| 147 |
'type' => 'text', |
| 148 |
'id' => 'quiz_slug', |
| 149 |
'desc' => sprintf( 'e.g. %s/course/sample-course/<code>quizzes</code>/sample-quiz/', home_url() ), |
| 150 |
'default' => 'quizzes', |
| 151 |
'placeholder' => 'quizzes', |
| 152 |
), |
| 153 |
array( |
| 154 |
'title' => esc_html__( 'Category base', 'learnpress' ), |
| 155 |
'id' => 'course_category_base', |
| 156 |
'default' => 'course-category', |
| 157 |
'type' => 'text', |
| 158 |
'placeholder' => 'course-category', |
| 159 |
'desc' => sprintf( 'e.g. %s/course/%s/sample-course/', home_url(), '<code>course-category</code>' ), |
| 160 |
), |
| 161 |
array( |
| 162 |
'title' => esc_html__( 'Tag base', 'learnpress' ), |
| 163 |
'id' => 'course_tag_base', |
| 164 |
'default' => 'course-tag', |
| 165 |
'type' => 'text', |
| 166 |
'placeholder' => 'course-tag', |
| 167 |
'desc' => sprintf( 'e.g. %s/course/%s/sample-course/', home_url(), '<code>course-tag</code>' ), |
| 168 |
), |
| 169 |
array( |
| 170 |
'type' => 'sectionend', |
| 171 |
), |
| 172 |
) |
| 173 |
) |
| 174 |
) |
| 175 |
); |
| 176 |
|