Changeset 2388997
- Timestamp:
- 09/26/2020 09:59:12 PM (5 years ago)
- Location:
- wp-courses/trunk
- Files:
-
- 4 edited
-
README.md (modified) (1 diff)
-
wp-courses.php (modified) (5 diffs)
-
wp-courses.pot (modified) (6 diffs)
-
wpc-options.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-courses/trunk/README.md
r2387944 r2388997 5 5 Requires at least: 4.6 6 6 Tested up to: 5.5.1 7 Stable tag: 2.0.2 77 Stable tag: 2.0.28 8 8 License: GPLv2 or later license 9 9 -
wp-courses/trunk/wp-courses.php
r2387944 r2388997 3 3 * Plugin Name: WP Courses LMS 4 4 * Description: WP Courses is a free learning management system (LMS) plugin for WordPress. It includes a rich feature set that allows you to create unlimited courses, restrict content and much more. 5 * Version: 2.0.2 75 * Version: 2.0.28 6 6 * Author: Myles English 7 7 * Plugin URI: https://wpcoursesplugin.com … … 292 292 } 293 293 add_action( 'admin_enqueue_scripts', 'wpc_enqueue_admin_scripts' ); 294 294 295 // Register Custom Post Type Course 295 296 function wpc_register_course_cp(){ 296 $labels = array(297 'name' => _x( 'Courses', 'post type general name'),298 'singular_name' => _x( 'Course', 'post type singular name'),299 'add_new' => _x( 'Add New', 'Course'),300 'add_new_item' => __( 'Add New Course'),301 'edit_item' => __( 'Edit Course' ),302 'new_item' => __( 'New Course' ),303 'all_items' => __( 'All Courses' ),304 'view_item' => __( 'View Course' ),305 'search_items' => __( 'Search Courses' ),306 'not_found' => __( 'No Courses Found' ),307 'not_found_in_trash' => __( 'No Courses Found in the Trash' ),308 'parent_item_colon' => '',309 'menu_name' => __('Courses', 'wp-courses'),297 $labels = array( 298 'name' => _x( 'Courses', 'post type general name'), 299 'singular_name' => _x( 'Course', 'post type singular name'), 300 'add_new' => _x( 'Add New', 'Course'), 301 'add_new_item' => __( 'Add New Course'), 302 'edit_item' => __( 'Edit Course' ), 303 'new_item' => __( 'New Course' ), 304 'all_items' => __( 'All Courses' ), 305 'view_item' => __( 'View Course' ), 306 'search_items' => __( 'Search Courses' ), 307 'not_found' => __( 'No Courses Found' ), 308 'not_found_in_trash' => __( 'No Courses Found in the Trash' ), 309 'parent_item_colon' => '', 310 'menu_name' => __('Courses', 'wp-courses'), 310 311 ); 311 $args = array( 312 'labels' => $labels, 313 'show_in_admin_bar' => true, 314 'menu_icon' => null, 315 'show_in_nav_menus' => false, 316 'publicly_queryable' => true, 317 'query_var' => true, 318 'can_export' => true, 319 'rewrite' => true, 320 'show_in_menu' => '', 321 'description' => __('Enter a Course Description Here', 'wp-courses'), 322 'public' => true, 323 'show_ui' => true, 324 'hierarchical' => false, 325 'supports' => array('title', 'editor', 'excerpt', 'page-attributes', 'thumbnail', 'custom-fields'), 326 'has_archive' => true, 327 'hierarchical' => false, 328 'show_in_rest' => true, 312 $args = array( 313 'labels' => $labels, 314 'show_in_admin_bar' => true, 315 'menu_icon' => null, 316 'show_in_nav_menus' => false, 317 'publicly_queryable' => true, 318 'query_var' => true, 319 'can_export' => true, 320 'rewrite' => true, 321 'show_in_menu' => '', 322 'description' => __('Enter a Course Description Here', 'wp-courses'), 323 'public' => true, 324 'show_ui' => true, 325 'hierarchical' => false, 326 'supports' => array('title', 'editor', 'excerpt', 'page-attributes', 'thumbnail', 'custom-fields'), 327 'has_archive' => true, 328 'show_in_rest' => false, 329 329 ); 330 331 $wpc_enable_rest_course = get_option( 'wpc_enable_rest_course' ); 332 333 if( $wpc_enable_rest_course == 'true' ){ 334 $args['show_in_rest'] = true; 335 } 336 330 337 register_post_type('course', $args); 331 338 flush_rewrite_rules(false); … … 383 390 'show_in_menu' => '', 384 391 'has_archive' => true, 385 'hierarchical' => false,392 'hierarchical' => true, 386 393 'public' => true, 387 394 'show_ui' => true, 388 ' hierarchical' => false,395 'show_in_rest' => false, 389 396 'labels' => $labels, 390 397 'description' => __('Enter a lesson description here', 'wp-courses'), 391 398 'supports' => array( 'title', 'editor', 'excerpt', 'comments', 'revisions', 'author', 'custom-fields', 'page-attributes'), 392 'show_in_rest' => true,393 399 ); 400 401 $wpc_enable_rest_lesson = get_option('wpc_enable_rest_lesson'); 402 403 if( $wpc_enable_rest_lesson == 'true' ){ 404 $args['show_in_rest'] = true; 405 } 406 394 407 register_post_type( 'lesson', $args ); 395 408 flush_rewrite_rules( false ); … … 419 432 // Register Custom Post Type Module 420 433 function wpc_register_module_cp(){ 421 $labels = array( 422 'name' => _x( 'Module', 'post type general name' ), 423 'singular_name' => _x( 'Module', 'post type singular name' ), 424 'add_new' => _x( 'Add New', 'Module' ), 425 'add_new_item' => __( 'Add New Module' ), 426 'edit_item' => __( 'Edit Module' ), 427 'new_item' => __( 'New Module' ), 428 'all_items' => __( 'All Modules' ), 429 'view_item' => __( 'View Module' ), 430 'search_items' => __( 'Search Modules' ), 431 'not_found' => __( 'No Modules found' ), 432 'not_found_in_trash' => __( 'No Modules found in the Trash' ), 433 'parent_item_colon' => '', 434 'menu_name' => __('Modules', 'wp-courses'), 435 ); 436 $args = array( 437 'show_in_admin_bar' => false, 438 'menu_icon' => null, 439 'show_in_nav_menus' => false, 440 'publicly_queryable' => true, 441 'exclude_from_search' => true, 442 'has_archive' => false, 443 'query_var' => true, 444 'can_export' => true, 445 'rewrite' => true, 446 'show_in_menu' => '', 447 'has_archive' => true, 448 'hierarchical' => false, 449 'public' => true, 450 'show_ui' => true, 451 'hierarchical' => false, 452 'labels' => $labels, 453 'description' => __('Enter a module description here', 'wp-courses'), 454 'supports' => array( 'title' ), 455 ); 456 register_post_type( 'wpc-module', $args ); 457 flush_rewrite_rules( false ); 434 435 $labels = array( 436 'name' => _x( 'Module', 'post type general name' ), 437 'singular_name' => _x( 'Module', 'post type singular name' ), 438 'add_new' => _x( 'Add New', 'Module' ), 439 'add_new_item' => __( 'Add New Module' ), 440 'edit_item' => __( 'Edit Module' ), 441 'new_item' => __( 'New Module' ), 442 'all_items' => __( 'All Modules' ), 443 'view_item' => __( 'View Module' ), 444 'search_items' => __( 'Search Modules' ), 445 'not_found' => __( 'No Modules found' ), 446 'not_found_in_trash' => __( 'No Modules found in the Trash' ), 447 'parent_item_colon' => '', 448 'menu_name' => __('Modules', 'wp-courses'), 449 ); 450 451 $args = array( 452 'show_in_admin_bar' => false, 453 'menu_icon' => null, 454 'show_in_nav_menus' => false, 455 'publicly_queryable' => true, 456 'exclude_from_search' => true, 457 'has_archive' => false, 458 'query_var' => true, 459 'can_export' => true, 460 'rewrite' => true, 461 'show_in_menu' => '', 462 'has_archive' => true, 463 'hierarchical' => false, 464 'public' => true, 465 'show_ui' => true, 466 'show_in_rest' => false, 467 'labels' => $labels, 468 'description' => __('Enter a module description here', 'wp-courses'), 469 'supports' => array( 'title' ), 470 ); 471 472 $wpc_enable_rest_lesson = get_option('wpc_enable_rest_lesson'); 473 474 if( $wpc_enable_rest_lesson == 'true' ){ 475 $args['show_in_rest'] = true; 476 } 477 478 register_post_type( 'wpc-module', $args ); 479 flush_rewrite_rules( false ); 480 458 481 } 459 482 add_action( 'init', 'wpc_register_module_cp' ); … … 510 533 'public' => true, 511 534 'show_ui' => true, 512 ' hierarchical' => false,535 'show_in_rest' => false, 513 536 'labels' => $labels, 514 537 'description' => __('Enter a Teacher Description Here', 'wp-courses'), 515 538 'supports' => array('title', 'editor', 'excerpt', 'page-attributes', 'thumbnail'), 516 'show_in_rest' => true,517 539 ); 540 541 $wpc_enable_rest_teacher = get_option('wpc_enable_rest_teacher'); 542 543 if( $wpc_enable_rest_teacher == 'true' ){ 544 $args['show_in_rest'] = true; 545 } 546 518 547 register_post_type('teacher', $args); 519 548 flush_rewrite_rules(false); -
wp-courses/trunk/wp-courses.pot
r2387944 r2388997 4 4 "Project-Id-Version: WP Courses LMS\n" 5 5 "Report-Msgid-Bugs-To: \n" 6 "POT-Creation-Date: 2020-09-2 4 22:12+0000\n"6 "POT-Creation-Date: 2020-09-26 21:56+0000\n" 7 7 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 8 8 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 158 158 msgstr "" 159 159 160 #: admin-nav-menu.php:11 wp-courses.php:3 09160 #: admin-nav-menu.php:11 wp-courses.php:310 161 161 msgid "Courses" 162 162 msgstr "" … … 183 183 msgstr "" 184 184 185 #: wp-courses.php:32 1185 #: wp-courses.php:322 186 186 msgid "Enter a Course Description Here" 187 187 msgstr "" 188 188 189 #: wp-courses.php:39 0189 #: wp-courses.php:397 190 190 msgid "Enter a lesson description here" 191 191 msgstr "" 192 192 193 #: wp-courses.php:4 53193 #: wp-courses.php:468 194 194 msgid "Enter a module description here" 195 195 msgstr "" 196 196 197 #: wp-courses.php:5 14197 #: wp-courses.php:537 198 198 msgid "Enter a Teacher Description Here" 199 199 msgstr "" … … 248 248 msgstr "" 249 249 250 #: wp-courses.php:37 1250 #: wp-courses.php:378 251 251 msgid "Lessons" 252 252 msgstr "" … … 280 280 msgstr "" 281 281 282 #: wp-courses.php:4 34282 #: wp-courses.php:448 283 283 msgid "Modules" 284 284 msgstr "" … … 414 414 msgstr "" 415 415 416 #: admin-nav-menu.php:29 wp-courses.php: 496416 #: admin-nav-menu.php:29 wp-courses.php:519 417 417 msgid "Teachers" 418 418 msgstr "" -
wp-courses/trunk/wpc-options.php
r2282707 r2388997 2 2 3 3 function wpc_register_settings() { 4 5 add_option( 'wpc_enable_rest_course', 'false'); 6 add_option( 'wpc_enable_rest_lesson', 'false'); 7 add_option( 'wpc_enable_rest_teacher', 'false'); 4 8 5 9 add_option( 'wpc_show_breadcrumb_trail', 'true'); … … 28 32 // register_setting( 'wpc_options', 'wpc_course_page', 'wpc_callback' ); 29 33 34 register_setting( 'wpc_options', 'wpc_enable_rest_course', 'wpc_callback' ); 35 register_setting( 'wpc_options', 'wpc_enable_rest_lesson', 'wpc_callback' ); 36 register_setting( 'wpc_options', 'wpc_enable_rest_teacher', 'wpc_callback' ); 37 30 38 register_setting( 'wpc_options', 'wpc_show_breadcrumb_trail', 'wpc_callback' ); 31 39 register_setting( 'wpc_options', 'wpc_show_lesson_numbers', 'wpc_callback' ); … … 64 72 settings_fields( 'wpc_options' ); 65 73 74 $wpc_enable_rest_course = get_option('wpc_enable_rest_course'); 75 $wpc_enable_rest_lesson = get_option('wpc_enable_rest_lesson'); 76 $wpc_enable_rest_teacher = get_option('wpc_enable_rest_teacher'); 77 66 78 $wpc_show_breadcrumb_trail = get_option('wpc_show_breadcrumb_trail'); 67 79 $wpc_show_lesson_numbers = get_option('wpc_show_lesson_numbers'); … … 88 100 $id = get_the_ID(); 89 101 102 if( $wpc_enable_rest_course == 'true' ){ 103 $rest_course_checked = 'checked'; 104 } else { 105 $rest_course_checked = ''; 106 } 107 108 if( $wpc_enable_rest_lesson == 'true' ){ 109 $rest_lesson_checked = 'checked'; 110 } else { 111 $rest_lesson_checked = ''; 112 } 113 114 if( $wpc_enable_rest_teacher == 'true' ){ 115 $rest_teacher_checked = 'checked'; 116 } else { 117 $rest_teacher_checked = ''; 118 } 119 90 120 if($wpc_show_breadcrumb_trail == 'true'){ 91 121 $breadcrumb_checked = 'checked'; … … 113 143 114 144 ?> 145 146 <div class="wpc-admin-box"> 147 148 <h2 class="wpc-admin-box-header">General Options</h2> 149 150 <h2>REST API</h2> 151 152 <div class="wpc-option"> 153 <input type="checkbox" id="wpc-enable-lesson-rest" name="wpc_enable_rest_lesson" value="true" <?php echo $rest_lesson_checked; ?>/><label for="wpc-enable-lesson-rest">Enable REST API for Lessons and Modules. <b>Warning!</b> If checked, restricted lesson content is accessable <b>TO ANYONE</b> via the REST API.</label> 154 </div> 155 156 <div class="wpc-option"> 157 <input type="checkbox" id="wpc-enable-course-rest" name="wpc_enable_rest_course" value="true" <?php echo $rest_course_checked; ?>/><label for="wpc-enable-course-rest">Enable REST API for Courses</label> 158 </div> 159 160 <div class="wpc-option"> 161 <input type="checkbox" id="wpc-enable-teacher-rest" name="wpc_enable_rest_teacher" value="true" <?php echo $rest_teacher_checked; ?>/><label for="wpc-enable-teacher-rest">Enable REST API for Teachers</label> 162 </div> 163 164 </div> 115 165 116 166 <div class="wpc-admin-box">
Note: See TracChangeset
for help on using the changeset viewer.