| @@ -1,138 +1,8 @@ | ||
| 1 | 1 | <?php |
| 2 | -/** | |
| 3 | - * Handle renamed/removed hooks | |
| 4 | - */ | |
| 5 | -global $lp_map_deprecated_filters; | |
| 6 | 2 | |
| 7 | -$lp_map_deprecated_filters = array( | |
| 8 | - 'learn_press_register_add_ons' => 'learn_press_loaded', | |
| 9 | -); | |
| 3 | +use LearnPress\Helpers\Template; | |
| 10 | 4 | |
| 11 | -foreach ( $lp_map_deprecated_filters as $old => $new ) { | |
| 12 | - add_filter( $old, 'lp_deprecated_filter_mapping', 9999999 ); | |
| 13 | -} | |
| 14 | - | |
| 15 | -function lp_deprecated_filter_mapping( $data, $arg_1 = '', $arg_2 = '', $arg_3 = '' ) { | |
| 16 | - global $lp_map_deprecated_filters, $wp_filter; | |
| 17 | - $filter = current_filter(); | |
| 18 | - if ( ! empty( $wp_filter[ $filter ] ) && count( $wp_filter[ $filter ] ) > 1 ) { | |
| 19 | - _deprecated_function( 'The ' . $filter . ' hook', '1.0', $lp_map_deprecated_filters[ $filter ] ); | |
| 20 | - } | |
| 21 | - | |
| 22 | - return $data; | |
| 23 | -} | |
| 24 | - | |
| 25 | -function learn_press_text_image( $text = null, $args = array() ) { | |
| 26 | - _deprecated_function( __FUNCTION__, '1.0' ); | |
| 27 | - $width = 200; | |
| 28 | - $height = 150; | |
| 29 | - $font_size = 1; | |
| 30 | - $background = 'FFFFFF'; | |
| 31 | - $color = '000000'; | |
| 32 | - $padding = 20; | |
| 33 | - | |
| 34 | - extract( $args ); | |
| 35 | - | |
| 36 | - // Output to browser | |
| 37 | - if ( empty( $_REQUEST['debug'] ) ) { | |
| 38 | - header( 'Content-Type: image/png' ); | |
| 39 | - } | |
| 40 | - /* | |
| 41 | - $uniqid = md5( serialize( array( 'width' => $width, 'height' => $height, 'text' => $text, 'background' => $background, 'color' => $color ) ) ); | |
| 42 | - @mkdir( LP_PLUGIN_PATH . '/cache' ); | |
| 43 | - $cache = LP_PLUGIN_PATH . '/cache/' . $uniqid . '.cache'; | |
| 44 | - if( file_exists( $cache ) ){ | |
| 45 | - readfile( $cache ); | |
| 46 | - die(); | |
| 47 | - }*/ | |
| 48 | - | |
| 49 | - $im = imagecreatetruecolor( $width, $height ); | |
| 50 | - | |
| 51 | - list( $r, $g, $b ) = sscanf( "#{$background}", '#%02x%02x%02x' ); | |
| 52 | - $background = imagecolorallocate( $im, $r, $g, $b ); | |
| 53 | - | |
| 54 | - list( $r, $g, $b ) = sscanf( "#{$color}", '#%02x%02x%02x' ); | |
| 55 | - $color = imagecolorallocate( $im, $r, $g, $b ); | |
| 56 | - | |
| 57 | - // Set the background to be white | |
| 58 | - imagefilledrectangle( $im, 0, 0, $width, $height, $background ); | |
| 59 | - | |
| 60 | - // Path to our font file | |
| 61 | - $font = LP_PLUGIN_PATH . '/assets/fonts/Sumana-Regular.ttf'; | |
| 62 | - $x = $width; | |
| 63 | - $loop = 0; | |
| 64 | - do { | |
| 65 | - // First we create our bounding box for the first text | |
| 66 | - $bbox = imagettfbbox( $font_size, 0, $font, $text ); | |
| 67 | - // This is our cordinates for X and Y | |
| 68 | - $x = $bbox[0] + ( imagesx( $im ) / 2 ) - ( $bbox[4] / 2 ); | |
| 69 | - $y = $bbox[1] + ( imagesy( $im ) / 2 ) - ( $bbox[5] / 2 ); | |
| 70 | - $font_size ++; | |
| 71 | - if ( $loop ++ > 100 ) { | |
| 72 | - break; | |
| 73 | - } | |
| 74 | - } while ( $x > $padding ); | |
| 75 | - // Write it | |
| 76 | - imagettftext( $im, $font_size, 0, $x - 5, $y, $color, $font, $text ); | |
| 77 | - imagepng( $im ); | |
| 78 | - // readfile( $cache ); | |
| 79 | - imagedestroy( $im ); | |
| 80 | -} | |
| 81 | - | |
| 82 | -/** | |
| 83 | - * Get all lessons in a course | |
| 84 | - * | |
| 85 | - * @param $course_id | |
| 86 | - * | |
| 87 | - * @return array | |
| 88 | - */ | |
| 89 | -function learn_press_get_lessons( $course_id ) { | |
| 90 | - _deprecated_function( __FUNCTION__, '1.0' ); | |
| 91 | - $lessons = array(); | |
| 92 | - $curriculum = get_post_meta( $course_id, '_lpr_course_lesson_quiz', true ); | |
| 93 | - if ( $curriculum ) { | |
| 94 | - foreach ( $curriculum as $lesson_quiz_s ) { | |
| 95 | - if ( array_key_exists( 'lesson_quiz', $lesson_quiz_s ) ) { | |
| 96 | - foreach ( $lesson_quiz_s['lesson_quiz'] as $lesson_quiz ) { | |
| 97 | - if ( get_post_type( $lesson_quiz ) == LP_LESSON_CPT ) { | |
| 98 | - $lessons[] = $lesson_quiz; | |
| 99 | - } | |
| 100 | - } | |
| 101 | - } | |
| 102 | - } | |
| 103 | - } | |
| 104 | - | |
| 105 | - return $lessons; | |
| 106 | -} | |
| 107 | - | |
| 108 | -/** | |
| 109 | - * @param $course_id | |
| 110 | - * | |
| 111 | - * @return array | |
| 112 | - */ | |
| 113 | -function learn_press_get_course_quizzes( $course_id ) { | |
| 114 | - _deprecated_function( __FUNCTION__, '1.0' ); | |
| 115 | - $quizzes = array(); | |
| 116 | - $curriculum = get_post_meta( $course_id, '_lpr_course_lesson_quiz', true ); | |
| 117 | - if ( $curriculum ) { | |
| 118 | - foreach ( $curriculum as $lesson_quiz_s ) { | |
| 119 | - if ( array_key_exists( 'lesson_quiz', $lesson_quiz_s ) ) { | |
| 120 | - foreach ( $lesson_quiz_s['lesson_quiz'] as $lesson_quiz ) { | |
| 121 | - if ( get_post_type( $lesson_quiz ) == LP_QUIZ_CPT ) { | |
| 122 | - $quizzes[] = $lesson_quiz; | |
| 123 | - } | |
| 124 | - } | |
| 125 | - } | |
| 126 | - } | |
| 127 | - } | |
| 128 | - | |
| 129 | - return $quizzes; | |
| 130 | -} | |
| 131 | - | |
| 132 | -// Deprecated template functions | |
| 133 | - | |
| 134 | - | |
| 135 | 5 | if ( ! function_exists( 'learn_press_course_content_lesson' ) ) { |
| 136 | 6 | /** |
| 137 | 7 | * Display course description |
| 138 | 8 | */ |
| @@ -321,66 +191,28 @@ | ||
| 321 | 191 | learn_press_get_template( 'content-quiz/sidebar-buttons.php' ); |
| 322 | 192 | } |
| 323 | 193 | } |
| 324 | 194 | |
| 325 | -if ( ! function_exists( '_learn_press_default_course_tabs' ) ) { | |
| 195 | +//if ( ! function_exists( '_learn_press_default_course_tabs' ) ) { | |
| 196 | +// | |
| 197 | +// /** | |
| 198 | +// * Add default tabs to course | |
| 199 | +// * | |
| 200 | +// * @param array $tabs | |
| 201 | +// * | |
| 202 | +// * @return array | |
| 203 | +// */ | |
| 204 | +// function _learn_press_default_course_tabs( $tabs = array() ) { | |
| 205 | +// _deprecated_function( __FUNCTION__, '3.0.0', 'learn_press_get_course_tabs' ); | |
| 206 | +// | |
| 207 | +// return learn_press_get_course_tabs(); | |
| 208 | +// } | |
| 209 | +//} | |
| 326 | 210 | |
| 327 | - /** | |
| 328 | - * Add default tabs to course | |
| 329 | - * | |
| 330 | - * @param array $tabs | |
| 331 | - * | |
| 332 | - * @return array | |
| 333 | - */ | |
| 334 | - function _learn_press_default_course_tabs( $tabs = array() ) { | |
| 335 | - _deprecated_function( __FUNCTION__, '3.0.0', 'learn_press_get_course_tabs' ); | |
| 336 | - | |
| 337 | - return learn_press_get_course_tabs(); | |
| 338 | - } | |
| 339 | -} | |
| 340 | - | |
| 341 | - | |
| 342 | -function learn_press_sanitize_json( $string ) { | |
| 343 | - | |
| 344 | - echo json_encode( $string ); | |
| 345 | - | |
| 346 | - return $string; | |
| 347 | -} | |
| 348 | - | |
| 349 | - | |
| 350 | -function learn_press_get_subtabs_course() { | |
| 351 | - $subtabs = array( | |
| 352 | - 'all' => __( 'All', 'learnpress' ), | |
| 353 | - 'learning' => __( 'Learning', 'learnpress' ), | |
| 354 | - 'purchased' => __( 'Purchased', 'learnpress' ), | |
| 355 | - 'finished' => __( 'Finished', 'learnpress' ), | |
| 356 | - 'own' => __( 'Owned', 'learnpress' ), | |
| 357 | - ); | |
| 358 | - | |
| 359 | - $subtabs = apply_filters( 'learn_press_profile_tab_courses_subtabs', $subtabs ); | |
| 360 | - | |
| 361 | - return $subtabs; | |
| 362 | -} | |
| 363 | - | |
| 364 | - | |
| 365 | -// ------------------------------- | |
| 366 | -// Validation Data Settings Page Before Save | |
| 367 | -add_filter( 'learn_press_update_option_value', 'learn_press_validation_data_before_save', 10, 2 ); | |
| 368 | - | |
| 369 | -function learn_press_validation_data_before_save( $value = '', $name = '' ) { | |
| 370 | - if ( $name === 'learn_press_profile_endpoints' ) { | |
| 371 | - | |
| 372 | - if ( empty( $value['profile-courses'] ) ) { | |
| 373 | - $value['profile-courses'] = 'courses'; | |
| 374 | - } | |
| 375 | - } | |
| 376 | - | |
| 377 | - return $value; | |
| 378 | -} | |
| 379 | - | |
| 380 | - | |
| 381 | 211 | // Show filters for students list |
| 382 | -function learn_press_get_students_list_filter() { | |
| 212 | +// Wait addon student list v4.0.3 update will remove it | |
| 213 | +// @deprecated 4.2.7.4 | |
| 214 | +/*function learn_press_get_students_list_filter() { | |
| 383 | 215 | $filter = array( |
| 384 | 216 | 'all' => esc_html__( 'All', 'learnpress' ), |
| 385 | 217 | 'in-progress' => esc_html__( 'In Progress', 'learnpress' ), |
| 386 | 218 | 'finished' => esc_html__( 'Finished', 'learnpress' ), |
| @@ -386,63 +218,11 @@ | ||
| 386 | 218 | 'finished' => esc_html__( 'Finished', 'learnpress' ), |
| 387 | 219 | ); |
| 388 | 220 | |
| 389 | 221 | return apply_filters( 'learn_press_get_students_list_filter', $filter ); |
| 390 | -} | |
| 391 | - | |
| 392 | -/** | |
| 393 | - * @depecated 4.1.6.9 | |
| 394 | - */ | |
| 395 | -/*function learn_press_get_request_args( $args = array() ) { | |
| 396 | - $request = array(); | |
| 397 | - if ( $args ) { | |
| 398 | - foreach ( $args as $key ) { | |
| 399 | - $request[] = array_key_exists( $key, $_REQUEST ) ? $_REQUEST[ $key ] : false; | |
| 400 | - } | |
| 401 | - } | |
| 402 | - | |
| 403 | - return $request; | |
| 404 | 222 | }*/ |
| 405 | 223 | |
| 406 | 224 | |
| 407 | -/** | |
| 408 | - * Redirect to question if user access to a quiz that user has started | |
| 409 | - * | |
| 410 | - * @param string | |
| 411 | - * | |
| 412 | - * @return string | |
| 413 | - */ | |
| 414 | -function learn_press_redirect_to_question( $template ) { | |
| 415 | - global $post_type; | |
| 416 | - if ( is_single() && $post_type == LP_QUIZ_CPT ) { | |
| 417 | - $user = learn_press_get_current_user(); | |
| 418 | - $quiz_id = get_the_ID(); | |
| 419 | - $quiz_status = $user->get_quiz_status( $quiz_id ); | |
| 420 | - if ( $quiz_status == 'started' && learn_press_get_quiz_time_remaining( $user->get_id(), $quiz_id ) == 0 && get_post_meta( $quiz_id, '_lpr_duration', true ) ) { | |
| 421 | - $user->finish_quiz( $quiz_id ); | |
| 422 | - $quiz_status = 'completed'; | |
| 423 | - } | |
| 424 | - $redirect = null; | |
| 425 | - if ( learn_press_get_request( 'question' ) && $quiz_status == '' ) { | |
| 426 | - $redirect = get_the_permalink( $quiz_id ); | |
| 427 | - } elseif ( $quiz_status == 'started' ) { | |
| 428 | - if ( learn_press_get_request( 'question' ) ) { | |
| 429 | - } else { | |
| 430 | - $redirect = learn_press_get_user_question_url( $quiz_id ); | |
| 431 | - } | |
| 432 | - } elseif ( $quiz_status == 'completed' && learn_press_get_request( 'question' ) ) { | |
| 433 | - $redirect = get_the_permalink( $quiz_id ); | |
| 434 | - } | |
| 435 | - if ( $redirect && ! learn_press_is_current_url( $redirect ) ) { | |
| 436 | - wp_redirect( $redirect ); | |
| 437 | - exit(); | |
| 438 | - } | |
| 439 | - } | |
| 440 | - | |
| 441 | - return $template; | |
| 442 | -} | |
| 443 | - | |
| 444 | - | |
| 445 | 225 | function learn_press_output_question_nonce( $question ) { |
| 446 | 226 | printf( '<input type="hidden" name="update-question-nonce" value="%s" />', wp_create_nonce( 'current-question-nonce-' . $question->id ) ); |
| 447 | 227 | } |
| 448 | 228 | |
| @@ -448,41 +228,28 @@ | ||
| 448 | 228 | |
| 449 | 229 | add_action( 'learn_press_after_question_wrap', 'learn_press_output_question_nonce' ); |
| 450 | 230 | |
| 451 | 231 | |
| 452 | -if ( ! function_exists( 'learn_press_course_nav_items' ) ) { | |
| 453 | - /** | |
| 454 | - * Displaying course items navigation | |
| 455 | - * | |
| 456 | - * @param null $item_id | |
| 457 | - * @param null $course_id | |
| 458 | - */ | |
| 459 | - function learn_press_course_nav_items( $item_id = null, $course_id = null ) { | |
| 460 | - learn_press_get_template( | |
| 461 | - 'single-course/nav-items.php', | |
| 462 | - array( | |
| 463 | - 'course_id' => $course_id, | |
| 464 | - 'item_id' => $item_id, | |
| 465 | - 'content_only' => learn_press_is_content_item_only(), | |
| 466 | - ) | |
| 467 | - ); | |
| 468 | - } | |
| 469 | -} | |
| 232 | +//if ( ! function_exists( 'learn_press_course_nav_items' ) ) { | |
| 233 | +// /** | |
| 234 | +// * Displaying course items navigation | |
| 235 | +// * | |
| 236 | +// * @param null $item_id | |
| 237 | +// * @param null $course_id | |
| 238 | +// */ | |
| 239 | +// function learn_press_course_nav_items( $item_id = null, $course_id = null ) { | |
| 240 | +// learn_press_get_template( | |
| 241 | +// 'single-course/nav-items.php', | |
| 242 | +// array( | |
| 243 | +// 'course_id' => $course_id, | |
| 244 | +// 'item_id' => $item_id, | |
| 245 | +// 'content_only' => learn_press_is_content_item_only(), | |
| 246 | +// ) | |
| 247 | +// ); | |
| 248 | +// } | |
| 249 | +//} | |
| 470 | 250 | |
| 471 | 251 | /** |
| 472 | - * Load course item content only | |
| 473 | - */ | |
| 474 | -function learn_press_load_content_item_only( $name ) { | |
| 475 | - if ( learn_press_is_content_item_only() ) { | |
| 476 | - if ( LearnPress::instance()->global['course-item'] ) { | |
| 477 | - remove_action( 'get_header', 'learn_press_load_content_item_only' ); | |
| 478 | - learn_press_get_template( 'single-course/content-item-only.php' ); | |
| 479 | - die(); | |
| 480 | - } | |
| 481 | - } | |
| 482 | -} | |
| 483 | - | |
| 484 | -/** | |
| 485 | 252 | * Version 3.3.0 |
| 486 | 253 | */ |
| 487 | 254 | |
| 488 | 255 | /** |
| @@ -493,9 +260,8 @@ | ||
| 493 | 260 | * Purchase course button. |
| 494 | 261 | */ |
| 495 | 262 | function learn_press_course_purchase_button() { |
| 496 | 263 | _deprecated_function( __FUNCTION__, '3.3.0' ); |
| 497 | - LearnPress::instance()->template( 'course' )->course_purchase_button(); | |
| 498 | 264 | } |
| 499 | 265 | } |
| 500 | 266 | |
| 501 | 267 | if ( ! function_exists( 'learn_press_course_enroll_button' ) ) { |
| @@ -503,288 +269,22 @@ | ||
| 503 | 269 | * Enroll course button. |
| 504 | 270 | */ |
| 505 | 271 | function learn_press_course_enroll_button() { |
| 506 | 272 | _deprecated_function( __FUNCTION__, '3.3.0' ); |
| 507 | - LearnPress::instance()->template( 'course' )->course_enroll_button(); | |
| 508 | 273 | } |
| 509 | 274 | } |
| 510 | 275 | |
| 511 | - | |
| 512 | -if ( ! function_exists( 'learn_press_course_retake_button' ) ) { | |
| 513 | - | |
| 514 | - /** | |
| 515 | - * Retake course button | |
| 516 | - * | |
| 517 | - * @deprecated 3.3.0 | |
| 518 | - */ | |
| 519 | - function learn_press_course_retake_button() { | |
| 520 | - _deprecated_function( __FUNCTION__, '3.3.0' ); | |
| 521 | - LearnPress::instance()->template( 'course' )->func( 'button_retry' ); | |
| 522 | - } | |
| 523 | -} | |
| 524 | - | |
| 525 | -if ( ! function_exists( 'learn_press_course_continue_button' ) ) { | |
| 526 | - | |
| 527 | - /** | |
| 528 | - * Retake course button | |
| 529 | - */ | |
| 530 | - function learn_press_course_continue_button() { | |
| 531 | - _deprecated_function( __FUNCTION__, '4.0.0' ); | |
| 532 | - LearnPress::instance()->template( 'course' )->func( 'course_continue_button' ); | |
| 533 | - } | |
| 534 | -} | |
| 535 | - | |
| 536 | - | |
| 537 | -if ( ! function_exists( 'learn_press_course_finish_button' ) ) { | |
| 538 | - | |
| 539 | - /** | |
| 540 | - * Retake course button | |
| 541 | - * | |
| 542 | - * @deprecated 3.3.0 | |
| 543 | - */ | |
| 544 | - function learn_press_course_finish_button() { | |
| 545 | - learn_press_add_message( | |
| 546 | - 'Deprecated: ' . __FUNCTION__ . ' is <strong>deprecated</strong> since version 3.3.0 with no alternative available. Please update LP v4.0.0', | |
| 547 | - 'warning' | |
| 548 | - ); | |
| 549 | - | |
| 550 | - LearnPress::instance()->template( 'course' )->func( 'course_finish_button' ); | |
| 551 | - } | |
| 552 | -} | |
| 553 | - | |
| 554 | 276 | if ( ! function_exists( 'learn_press_course_external_button' ) ) { |
| 555 | 277 | |
| 556 | 278 | /** |
| 557 | 279 | * Retake course button |
| 280 | + * @deprecated 4.2.5.3 | |
| 558 | 281 | */ |
| 559 | 282 | function learn_press_course_external_button() { |
| 560 | - LearnPress::instance()->template( 'course' )->func( 'course_external_button' ); | |
| 283 | + _deprecated_function( __FUNCTION__, '4.2.5.3' ); | |
| 561 | 284 | } |
| 562 | 285 | } |
| 563 | 286 | |
| 564 | - | |
| 565 | -if ( ! function_exists( 'learn_press_curriculum_section_title' ) ) { | |
| 566 | - | |
| 567 | - /** | |
| 568 | - * Section title | |
| 569 | - * | |
| 570 | - * @param LP_Course_Section $section | |
| 571 | - * | |
| 572 | - * @hooked learn-press/section-summary | |
| 573 | - */ | |
| 574 | - function learn_press_curriculum_section_title( $section ) { | |
| 575 | - learn_press_get_template( 'single-course/section/title.php', array( 'section' => $section ) ); | |
| 576 | - } | |
| 577 | -} | |
| 578 | - | |
| 579 | -if ( ! function_exists( 'learn_press_curriculum_section_content' ) ) { | |
| 580 | - | |
| 581 | - /** | |
| 582 | - * Section content | |
| 583 | - * | |
| 584 | - * @param LP_Course_Section $section | |
| 585 | - * | |
| 586 | - * @hooked learn-press/section-summary | |
| 587 | - */ | |
| 588 | - function learn_press_curriculum_section_content( $section ) { | |
| 589 | - learn_press_get_template( 'single-course/section/content.php', array( 'section' => $section ) ); | |
| 590 | - } | |
| 591 | -} | |
| 592 | - | |
| 593 | -if ( ! function_exists( 'learn_press_checkout_form_login' ) ) { | |
| 594 | - | |
| 595 | - /** | |
| 596 | - * Output login form before checkout form if user is not logged in | |
| 597 | - * | |
| 598 | - * @hooked learn-press/before-checkout-form | |
| 599 | - */ | |
| 600 | - function learn_press_checkout_form_login() { | |
| 601 | - | |
| 602 | - if ( ! LearnPress::instance()->checkout()->is_enable_login() ) { | |
| 603 | - return; | |
| 604 | - } | |
| 605 | - | |
| 606 | - learn_press_get_template( 'checkout/form-login.php' ); | |
| 607 | - } | |
| 608 | -} | |
| 609 | - | |
| 610 | -if ( ! function_exists( 'learn_press_checkout_form_register' ) ) { | |
| 611 | - | |
| 612 | - /** | |
| 613 | - * Output register form before checkout form if user is not logged in. | |
| 614 | - * | |
| 615 | - * @hooked learn-press/before-checkout-form | |
| 616 | - */ | |
| 617 | - function learn_press_checkout_form_register() { | |
| 618 | - | |
| 619 | - if ( ! LearnPress::instance()->checkout()->is_enable_register() ) { | |
| 620 | - return; | |
| 621 | - } | |
| 622 | - | |
| 623 | - learn_press_get_template( 'checkout/form-register.php' ); | |
| 624 | - } | |
| 625 | -} | |
| 626 | - | |
| 627 | -if ( ! function_exists( 'learn_press_order_review' ) ) { | |
| 628 | - /** | |
| 629 | - * Output order details | |
| 630 | - * | |
| 631 | - * @hooked learn-press/checkout-order-review | |
| 632 | - */ | |
| 633 | - function learn_press_order_review() { | |
| 634 | - learn_press_get_template( 'checkout/review-order.php' ); | |
| 635 | - } | |
| 636 | -} | |
| 637 | - | |
| 638 | -if ( ! function_exists( 'learn_press_order_payment' ) ) { | |
| 639 | - /** | |
| 640 | - * Output payment methods | |
| 641 | - * | |
| 642 | - * @hooked learn-press/checkout-order-review | |
| 643 | - */ | |
| 644 | - function learn_press_order_payment() { | |
| 645 | - $available_gateways = LP_Gateways::instance()->get_available_payment_gateways(); | |
| 646 | - | |
| 647 | - learn_press_get_template( 'checkout/payment.php', array( 'available_gateways' => $available_gateways ) ); | |
| 648 | - } | |
| 649 | -} | |
| 650 | - | |
| 651 | -if ( ! function_exists( 'learn_press_order_guest_email' ) ) { | |
| 652 | - /** | |
| 653 | - * Output payment methods | |
| 654 | - * | |
| 655 | - * @hooked learn-press/checkout-order-review | |
| 656 | - */ | |
| 657 | - function learn_press_order_guest_email() { | |
| 658 | - $checkout = LearnPress::instance()->checkout(); | |
| 659 | - if ( $checkout->is_enable_guest_checkout() && ! is_user_logged_in() ) { | |
| 660 | - learn_press_get_template( 'checkout/guest-email.php' ); | |
| 661 | - } | |
| 662 | - } | |
| 663 | -} | |
| 664 | - | |
| 665 | -if ( ! function_exists( 'learn_press_order_comment' ) ) { | |
| 666 | - /** | |
| 667 | - * Output order comment input | |
| 668 | - * | |
| 669 | - * @hooked learn-press/checkout-order-review | |
| 670 | - */ | |
| 671 | - function learn_press_order_comment() { | |
| 672 | - learn_press_get_template( 'checkout/order-comment.php' ); | |
| 673 | - } | |
| 674 | -} | |
| 675 | - | |
| 676 | -if ( ! function_exists( 'learn_press_user_profile_header' ) ) { | |
| 677 | - /** | |
| 678 | - * Output order comment input | |
| 679 | - * | |
| 680 | - * @hooked learn-press/before-user-profile | |
| 681 | - */ | |
| 682 | - function learn_press_user_profile_header( $user ) { | |
| 683 | - $profile = LP_Global::profile(); | |
| 684 | - | |
| 685 | - if ( $profile->get_user()->is_guest() ) { | |
| 686 | - return; | |
| 687 | - } | |
| 688 | - | |
| 689 | - learn_press_get_template( 'profile/profile-cover.php', array( 'user' => $user ) ); | |
| 690 | - } | |
| 691 | -} | |
| 692 | - | |
| 693 | -if ( ! function_exists( 'learn_press_user_profile_content' ) ) { | |
| 694 | - /** | |
| 695 | - * Output order comment input | |
| 696 | - * | |
| 697 | - * @hooked learn-press/user-profile | |
| 698 | - */ | |
| 699 | - function learn_press_user_profile_content( $user ) { | |
| 700 | - $profile = LP_Global::profile(); | |
| 701 | - | |
| 702 | - if ( $profile->get_user()->is_guest() ) { | |
| 703 | - return; | |
| 704 | - } | |
| 705 | - | |
| 706 | - learn_press_get_template( 'profile/content.php', array( 'user' => $user ) ); | |
| 707 | - } | |
| 708 | -} | |
| 709 | - | |
| 710 | -if ( ! function_exists( 'learn_press_user_profile_footer' ) ) { | |
| 711 | - /** | |
| 712 | - * Output order comment input | |
| 713 | - * | |
| 714 | - * @hooked learn-press/after-user-profile | |
| 715 | - */ | |
| 716 | - function learn_press_user_profile_footer( $user ) { | |
| 717 | - // learn_press_get_template( 'profile/footer.php', array( 'user' => $user ) ); | |
| 718 | - } | |
| 719 | -} | |
| 720 | - | |
| 721 | -if ( ! function_exists( 'learn_press_user_profile_tabs' ) ) { | |
| 722 | - /** | |
| 723 | - * Get tabs for user profile | |
| 724 | - * | |
| 725 | - * @param $user | |
| 726 | - */ | |
| 727 | - function learn_press_user_profile_tabs( $user = null ) { | |
| 728 | - $profile = LP_Global::profile(); | |
| 729 | - | |
| 730 | - if ( $profile->get_user()->is_guest() ) { | |
| 731 | - return; | |
| 732 | - } | |
| 733 | - | |
| 734 | - learn_press_get_template( 'profile/tabs.php', array( 'user' => $user ) ); | |
| 735 | - } | |
| 736 | -} | |
| 737 | - | |
| 738 | -if ( ! function_exists( 'learn_press_single_course_summary' ) ) { | |
| 739 | - /** | |
| 740 | - * Display content of single course summary | |
| 741 | - */ | |
| 742 | - function learn_press_single_course_summary() { | |
| 743 | - if ( learn_press_is_learning_course() ) { | |
| 744 | - learn_press_get_template( 'single-course/content-learning.php' ); | |
| 745 | - } else { | |
| 746 | - learn_press_get_template( 'single-course/content-landing.php' ); | |
| 747 | - } | |
| 748 | - } | |
| 749 | -} | |
| 750 | - | |
| 751 | -if ( ! function_exists( 'learn_press_course_price' ) ) { | |
| 752 | - /** | |
| 753 | - * Display course price. | |
| 754 | - * @deprecated 4.0.0 | |
| 755 | - */ | |
| 756 | - function learn_press_course_price() { | |
| 757 | - _deprecated_function( __FUNCTION__, '4.0.0' ); | |
| 758 | - $user = learn_press_get_current_user(); | |
| 759 | - $course = learn_press_get_course(); | |
| 760 | - | |
| 761 | - if ( $user && $user->has_enrolled_course( $course->get_id() ) ) { | |
| 762 | - return; | |
| 763 | - } | |
| 764 | - | |
| 765 | - learn_press_get_template( 'single-course/price.php' ); | |
| 766 | - } | |
| 767 | -} | |
| 768 | - | |
| 769 | -if ( ! function_exists( 'learn_press_course_meta_start_wrapper' ) ) { | |
| 770 | - /** | |
| 771 | - * Output the thumbnail of the course within loop | |
| 772 | - */ | |
| 773 | - function learn_press_course_meta_start_wrapper() { | |
| 774 | - learn_press_get_template( 'global/course-meta-start.php' ); | |
| 775 | - } | |
| 776 | -} | |
| 777 | - | |
| 778 | -if ( ! function_exists( 'learn_press_course_meta_end_wrapper' ) ) { | |
| 779 | - /** | |
| 780 | - * Output the thumbnail of the course within loop | |
| 781 | - */ | |
| 782 | - function learn_press_course_meta_end_wrapper() { | |
| 783 | - learn_press_get_template( 'global/course-meta-end.php' ); | |
| 784 | - } | |
| 785 | -} | |
| 786 | - | |
| 787 | 287 | if ( ! function_exists( 'learn_press_course_students' ) ) { |
| 788 | 288 | /** |
| 789 | 289 | * Display course students |
| 790 | 290 | */ |
| @@ -792,20 +292,21 @@ | ||
| 792 | 292 | learn_press_get_template( 'single-course/students.php' ); |
| 793 | 293 | } |
| 794 | 294 | } |
| 795 | 295 | |
| 796 | -if ( ! function_exists( 'learn_press_course_status' ) ) { | |
| 797 | - /** | |
| 798 | - * Display the title for single course | |
| 799 | - */ | |
| 800 | - function learn_press_course_status() { | |
| 801 | - learn_press_get_template( 'single-course/status.php' ); | |
| 802 | - } | |
| 803 | -} | |
| 296 | +//if ( ! function_exists( 'learn_press_course_status' ) ) { | |
| 297 | +// /** | |
| 298 | +// * Display the title for single course | |
| 299 | +// */ | |
| 300 | +// function learn_press_course_status() { | |
| 301 | +// learn_press_get_template( 'single-course/status.php' ); | |
| 302 | +// } | |
| 303 | +//} | |
| 804 | 304 | |
| 805 | 305 | if ( ! function_exists( 'learn_press_courses_loop_item_instructor' ) ) { |
| 806 | 306 | /** |
| 807 | 307 | * Output the instructor of the course within loop |
| 308 | + * @using in many themes. | |
| 808 | 309 | */ |
| 809 | 310 | function learn_press_courses_loop_item_instructor() { |
| 810 | 311 | learn_press_get_template( 'loop/course/instructor.php' ); |
| 811 | 312 | } |
| @@ -813,22 +314,22 @@ | ||
| 813 | 314 | |
| 814 | 315 | if ( ! function_exists( 'learn_press_course_tabs' ) ) { |
| 815 | 316 | /* |
| 816 | 317 | * Output course tabs |
| 318 | + * @using in theme starkid | |
| 817 | 319 | */ |
| 818 | - | |
| 819 | 320 | function learn_press_course_tabs() { |
| 820 | 321 | learn_press_get_template( 'single-course/tabs/tabs.php' ); |
| 821 | 322 | } |
| 822 | 323 | } |
| 823 | 324 | |
| 824 | -if ( ! function_exists( 'learn_press_content_item_quiz_title' ) ) { | |
| 325 | +/*if ( ! function_exists( 'learn_press_content_item_quiz_title' ) ) { | |
| 825 | 326 | function learn_press_content_item_quiz_title() { |
| 826 | 327 | learn_press_get_template( 'content-quiz/title.php' ); |
| 827 | 328 | } |
| 828 | -} | |
| 329 | +}*/ | |
| 829 | 330 | |
| 830 | -if ( ! function_exists( 'learn_press_content_item_quiz_intro' ) ) { | |
| 331 | +/*if ( ! function_exists( 'learn_press_content_item_quiz_intro' ) ) { | |
| 831 | 332 | function learn_press_content_item_quiz_intro() { |
| 832 | 333 | $course = learn_press_get_course(); |
| 833 | 334 | $user = learn_press_get_current_user(); |
| 834 | 335 | $quiz = LP_Global::course_item_quiz(); |
| @@ -846,11 +347,11 @@ | ||
| 846 | 347 | } |
| 847 | 348 | |
| 848 | 349 | learn_press_get_template( 'content-quiz/intro.php' ); |
| 849 | 350 | } |
| 850 | -} | |
| 351 | +}*/ | |
| 851 | 352 | |
| 852 | -if ( ! function_exists( 'learn_press_content_item_summary_quiz_content' ) ) { | |
| 353 | +/*if ( ! function_exists( 'learn_press_content_item_summary_quiz_content' ) ) { | |
| 853 | 354 | |
| 854 | 355 | function learn_press_content_item_summary_quiz_content() { |
| 855 | 356 | $item = LP_Global::course_item(); |
| 856 | 357 | |
| @@ -857,11 +358,11 @@ | ||
| 857 | 358 | if ( ! $item->get_viewing_question() ) { |
| 858 | 359 | learn_press_get_template( 'content-quiz/description.php' ); |
| 859 | 360 | } |
| 860 | 361 | } |
| 861 | -} | |
| 362 | +}*/ | |
| 862 | 363 | |
| 863 | -if ( ! function_exists( 'learn_press_content_item_summary_question_title' ) ) { | |
| 364 | +/*if ( ! function_exists( 'learn_press_content_item_summary_question_title' ) ) { | |
| 864 | 365 | |
| 865 | 366 | function learn_press_content_item_summary_question_title() { |
| 866 | 367 | $quiz = LP_Global::course_item_quiz(); |
| 867 | 368 | |
| @@ -868,11 +369,11 @@ | ||
| 868 | 369 | if ( $question = $quiz->get_viewing_question() ) { |
| 869 | 370 | learn_press_get_template( 'content-question/title.php' ); |
| 870 | 371 | } |
| 871 | 372 | } |
| 872 | -} | |
| 373 | +}*/ | |
| 873 | 374 | |
| 874 | -if ( ! function_exists( 'learn_press_content_item_summary_quiz_progress' ) ) { | |
| 375 | +/*if ( ! function_exists( 'learn_press_content_item_summary_quiz_progress' ) ) { | |
| 875 | 376 | |
| 876 | 377 | function learn_press_content_item_summary_quiz_progress() { |
| 877 | 378 | $course = learn_press_get_course(); |
| 878 | 379 | $quiz = LP_Global::course_item_quiz(); |
| @@ -889,11 +390,11 @@ | ||
| 889 | 390 | if ( $question = $quiz->get_viewing_question() ) { |
| 890 | 391 | learn_press_get_template( 'content-quiz/progress.php' ); |
| 891 | 392 | } |
| 892 | 393 | } |
| 893 | -} | |
| 394 | +}*/ | |
| 894 | 395 | |
| 895 | -if ( ! function_exists( 'learn_press_content_item_summary_quiz_countdown' ) ) { | |
| 396 | +/*if ( ! function_exists( 'learn_press_content_item_summary_quiz_countdown' ) ) { | |
| 896 | 397 | |
| 897 | 398 | function learn_press_content_item_summary_quiz_countdown() { |
| 898 | 399 | $quiz = LP_Global::course_item_quiz(); |
| 899 | 400 | |
| @@ -900,41 +401,12 @@ | ||
| 900 | 401 | if ( $question = $quiz->get_viewing_question() ) { |
| 901 | 402 | learn_press_get_template( 'content-quiz/countdown.php' ); |
| 902 | 403 | } |
| 903 | 404 | } |
| 904 | -} | |
| 905 | - | |
| 906 | -/** | |
| 907 | - * @depecated 4.1.6.9 | |
| 908 | - */ | |
| 909 | -/*if ( ! function_exists( 'learn_press_content_item_summary_quiz_result' ) ) { | |
| 910 | - | |
| 911 | - function learn_press_content_item_summary_quiz_result() { | |
| 912 | - $quiz = LP_Global::course_item_quiz(); | |
| 913 | - $user = learn_press_get_current_user(); | |
| 914 | - if ( ! $user->has_completed_quiz( $quiz->get_id(), get_the_ID() ) ) { | |
| 915 | - return; | |
| 916 | - } | |
| 917 | - learn_press_get_template( 'content-quiz/result.php' ); | |
| 918 | - } | |
| 919 | 405 | }*/ |
| 920 | 406 | |
| 921 | -/** | |
| 922 | - * @depecated 4.1.6.9 | |
| 923 | - */ | |
| 924 | -/*if ( ! function_exists( 'learn_press_content_item_summary_quiz_question' ) ) { | |
| 407 | +/*if ( ! function_exists( 'learn_press_content_item_summary_question_content' ) ) { | |
| 925 | 408 | |
| 926 | - function learn_press_content_item_summary_quiz_question() { | |
| 927 | - $quiz = LP_Global::course_item_quiz(); | |
| 928 | - | |
| 929 | - if ( $question = $quiz->get_viewing_question() ) { | |
| 930 | - learn_press_get_template( 'content-question/content.php' ); | |
| 931 | - } | |
| 932 | - } | |
| 933 | -}*/ | |
| 934 | - | |
| 935 | -if ( ! function_exists( 'learn_press_content_item_summary_question_content' ) ) { | |
| 936 | - | |
| 937 | 409 | function learn_press_content_item_summary_question_content() { |
| 938 | 410 | $quiz = LP_Global::course_item_quiz(); |
| 939 | 411 | |
| 940 | 412 | if ( $question = $quiz->get_viewing_question() ) { |
| @@ -940,93 +412,94 @@ | ||
| 940 | 412 | if ( $question = $quiz->get_viewing_question() ) { |
| 941 | 413 | learn_press_get_template( 'content-question/description.php' ); |
| 942 | 414 | } |
| 943 | 415 | } |
| 944 | -} | |
| 416 | +}*/ | |
| 945 | 417 | |
| 946 | -if ( ! function_exists( 'learn_press_content_item_summary_quiz_buttons' ) ) { | |
| 418 | +/*if ( ! function_exists( 'learn_press_content_item_summary_quiz_buttons' ) ) { | |
| 947 | 419 | |
| 948 | 420 | function learn_press_content_item_summary_quiz_buttons() { |
| 949 | 421 | _deprecated_function( __FUNCTION__, '3.3.0' ); |
| 950 | 422 | learn_press_get_template( 'content-quiz/buttons.php' ); |
| 951 | 423 | } |
| 952 | -} | |
| 424 | +}*/ | |
| 953 | 425 | |
| 954 | -if ( ! function_exists( 'learn_press_profile_recover_order_form' ) ) { | |
| 426 | +/*if ( ! function_exists( 'learn_press_profile_recover_order_form' ) ) { | |
| 955 | 427 | function learn_press_profile_recover_order_form( $order ) { |
| 956 | 428 | learn_press_get_template( 'profile/tabs/orders/recover-order.php', array( 'order' => $order ) ); |
| 957 | 429 | } |
| 958 | -} | |
| 430 | +}*/ | |
| 959 | 431 | |
| 960 | 432 | |
| 961 | -if ( ! function_exists( 'learn_press_wrapper_start' ) ) { | |
| 962 | - /** | |
| 963 | - * Wrapper Start | |
| 964 | - */ | |
| 965 | - function learn_press_wrapper_start() { | |
| 966 | - learn_press_get_template( 'global/before-main-content.php' ); | |
| 967 | - } | |
| 968 | -} | |
| 433 | +//if ( ! function_exists( 'learn_press_wrapper_start' ) ) { | |
| 434 | +// /** | |
| 435 | +// * Wrapper Start | |
| 436 | +// */ | |
| 437 | +// function learn_press_wrapper_start() { | |
| 438 | +// learn_press_get_template( 'global/before-main-content.php' ); | |
| 439 | +// } | |
| 440 | +//} | |
| 969 | 441 | |
| 970 | -if ( ! function_exists( 'learn_press_wrapper_end' ) ) { | |
| 971 | - /** | |
| 972 | - * wrapper end | |
| 973 | - */ | |
| 974 | - function learn_press_wrapper_end() { | |
| 975 | - learn_press_get_template( 'global/after-main-content.php' ); | |
| 976 | - } | |
| 977 | -} | |
| 442 | +//if ( ! function_exists( 'learn_press_wrapper_end' ) ) { | |
| 443 | +// /** | |
| 444 | +// * wrapper end | |
| 445 | +// */ | |
| 446 | +// function learn_press_wrapper_end() { | |
| 447 | +// learn_press_get_template( 'global/after-main-content.php' ); | |
| 448 | +// } | |
| 449 | +//} | |
| 978 | 450 | |
| 979 | -if ( ! function_exists( 'learn_press_courses_loop_item_thumbnail' ) ) { | |
| 980 | - /** | |
| 981 | - * Output the thumbnail of the course within loop | |
| 982 | - */ | |
| 983 | - function learn_press_courses_loop_item_thumbnail() { | |
| 984 | - learn_press_get_template( 'loop/course/thumbnail.php' ); | |
| 985 | - } | |
| 986 | -} | |
| 451 | +//if ( ! function_exists( 'learn_press_courses_loop_item_thumbnail' ) ) { | |
| 452 | +// /** | |
| 453 | +// * Output the thumbnail of the course within loop | |
| 454 | +// */ | |
| 455 | +// function learn_press_courses_loop_item_thumbnail() { | |
| 456 | +// learn_press_get_template( 'loop/course/thumbnail.php' ); | |
| 457 | +// } | |
| 458 | +//} | |
| 987 | 459 | |
| 988 | 460 | |
| 989 | 461 | |
| 990 | -if ( ! function_exists( 'learn_press_courses_loop_item_title' ) ) { | |
| 991 | - /** | |
| 992 | - * Output the title of the course within loop | |
| 993 | - */ | |
| 994 | - function learn_press_courses_loop_item_title() { | |
| 995 | - learn_press_get_template( 'loop/course/title.php' ); | |
| 996 | - } | |
| 997 | -} | |
| 462 | +//if ( ! function_exists( 'learn_press_courses_loop_item_title' ) ) { | |
| 463 | +// /** | |
| 464 | +// * Output the title of the course within loop | |
| 465 | +// */ | |
| 466 | +// function learn_press_courses_loop_item_title() { | |
| 467 | +// learn_press_get_template( 'loop/course/title.php' ); | |
| 468 | +// } | |
| 469 | +//} | |
| 998 | 470 | |
| 999 | -if ( ! function_exists( 'learn_press_courses_loop_item_begin_meta' ) ) { | |
| 1000 | - /** | |
| 1001 | - * Output the excerpt of the course within loop | |
| 1002 | - */ | |
| 1003 | - function learn_press_courses_loop_item_begin_meta() { | |
| 1004 | - learn_press_get_template( 'loop/course/meta-begin.php' ); | |
| 1005 | - } | |
| 1006 | -} | |
| 471 | +//if ( ! function_exists( 'learn_press_courses_loop_item_begin_meta' ) ) { | |
| 472 | +// /** | |
| 473 | +// * Output the excerpt of the course within loop | |
| 474 | +// */ | |
| 475 | +// function learn_press_courses_loop_item_begin_meta() { | |
| 476 | +// learn_press_get_template( 'loop/course/meta-begin.php' ); | |
| 477 | +// } | |
| 478 | +//} | |
| 1007 | 479 | |
| 1008 | -if ( ! function_exists( 'learn_press_courses_loop_item_end_meta' ) ) { | |
| 1009 | - /** | |
| 1010 | - * Output the excerpt of the course within loop | |
| 1011 | - */ | |
| 1012 | - function learn_press_courses_loop_item_end_meta() { | |
| 1013 | - learn_press_get_template( 'loop/course/meta-end.php' ); | |
| 1014 | - } | |
| 1015 | -} | |
| 480 | +//if ( ! function_exists( 'learn_press_courses_loop_item_end_meta' ) ) { | |
| 481 | +// /** | |
| 482 | +// * Output the excerpt of the course within loop | |
| 483 | +// */ | |
| 484 | +// function learn_press_courses_loop_item_end_meta() { | |
| 485 | +// learn_press_get_template( 'loop/course/meta-end.php' ); | |
| 486 | +// } | |
| 487 | +//} | |
| 1016 | 488 | |
| 1017 | -if ( ! function_exists( 'learn_press_courses_loop_item_introduce' ) ) { | |
| 1018 | - /** | |
| 1019 | - * Output the excerpt of the course within loop | |
| 1020 | - */ | |
| 1021 | - function learn_press_courses_loop_item_introduce() { | |
| 1022 | - learn_press_get_template( 'loop/course/introduce.php' ); | |
| 1023 | - } | |
| 1024 | -} | |
| 489 | +//if ( ! function_exists( 'learn_press_courses_loop_item_introduce' ) ) { | |
| 490 | +// /** | |
| 491 | +// * Output the excerpt of the course within loop | |
| 492 | +// */ | |
| 493 | +// function learn_press_courses_loop_item_introduce() { | |
| 494 | +// learn_press_get_template( 'loop/course/introduce.php' ); | |
| 495 | +// } | |
| 496 | +//} | |
| 1025 | 497 | |
| 1026 | 498 | if ( ! function_exists( 'learn_press_courses_loop_item_price' ) ) { |
| 1027 | 499 | /** |
| 1028 | 500 | * Output the price of the course within loop |
| 501 | + * @using in many themes. | |
| 1029 | 502 | */ |
| 1030 | 503 | function learn_press_courses_loop_item_price() { |
| 1031 | 504 | learn_press_get_template( 'loop/course/price.php' ); |
| 1032 | 505 | } |
| @@ -1034,8 +507,9 @@ | ||
| 1034 | 507 | |
| 1035 | 508 | if ( ! function_exists( 'learn_press_begin_courses_loop' ) ) { |
| 1036 | 509 | /** |
| 1037 | 510 | * Output the price of the course within loop |
| 511 | + * @using in many themes. | |
| 1038 | 512 | */ |
| 1039 | 513 | function learn_press_begin_courses_loop() { |
| 1040 | 514 | learn_press_get_template( 'loop/course/loop-begin.php' ); |
| 1041 | 515 | } |
| @@ -1043,8 +517,9 @@ | ||
| 1043 | 517 | |
| 1044 | 518 | if ( ! function_exists( 'learn_press_end_courses_loop' ) ) { |
| 1045 | 519 | /** |
| 1046 | 520 | * Output the price of the course within loop |
| 521 | + * @using in many themes. | |
| 1047 | 522 | */ |
| 1048 | 523 | function learn_press_end_courses_loop() { |
| 1049 | 524 | learn_press_get_template( 'loop/course/loop-end.php' ); |
| 1050 | 525 | } |
| @@ -1049,62 +524,63 @@ | ||
| 1049 | 524 | learn_press_get_template( 'loop/course/loop-end.php' ); |
| 1050 | 525 | } |
| 1051 | 526 | } |
| 1052 | 527 | |
| 1053 | -if ( ! function_exists( 'learn_press_courses_loop_item_students' ) ) { | |
| 1054 | - /** | |
| 1055 | - * Output the students of the course within loop | |
| 1056 | - * @deprecated 4.0.0 | |
| 1057 | - */ | |
| 1058 | - function learn_press_courses_loop_item_students() { | |
| 1059 | - _deprecated_function( __FUNCTION__, '4.0.0' ); | |
| 1060 | - echo '<div class="clearfix"></div>'; | |
| 1061 | - learn_press_get_template( 'loop/course/students.php' ); | |
| 1062 | - } | |
| 1063 | -} | |
| 528 | +//if ( ! function_exists( 'learn_press_courses_loop_item_students' ) ) { | |
| 529 | +// /** | |
| 530 | +// * Output the students of the course within loop | |
| 531 | +// * @deprecated 4.0.0 | |
| 532 | +// */ | |
| 533 | +// function learn_press_courses_loop_item_students() { | |
| 534 | +// _deprecated_function( __FUNCTION__, '4.0.0' ); | |
| 535 | +// echo '<div class="clearfix"></div>'; | |
| 536 | +// learn_press_get_template( 'loop/course/students.php' ); | |
| 537 | +// } | |
| 538 | +//} | |
| 1064 | 539 | |
| 1065 | -if ( ! function_exists( 'learn_press_courses_pagination' ) ) { | |
| 1066 | - /** | |
| 1067 | - * Output the pagination of archive courses | |
| 1068 | - */ | |
| 1069 | - function learn_press_courses_pagination() { | |
| 1070 | - learn_press_get_template( 'loop/course/pagination.php' ); | |
| 1071 | - } | |
| 1072 | -} | |
| 540 | +//if ( ! function_exists( 'learn_press_courses_pagination' ) ) { | |
| 541 | +// /** | |
| 542 | +// * Output the pagination of archive courses | |
| 543 | +// */ | |
| 544 | +// function learn_press_courses_pagination() { | |
| 545 | +// learn_press_get_template( 'loop/course/pagination.php' ); | |
| 546 | +// } | |
| 547 | +//} | |
| 1073 | 548 | |
| 1074 | -if ( ! function_exists( 'learn_press_output_single_course_learning_summary' ) ) { | |
| 1075 | - /** | |
| 1076 | - * Output the content of learning course content | |
| 1077 | - */ | |
| 1078 | - function learn_press_output_single_course_learning_summary() { | |
| 1079 | - learn_press_get_template( 'single-course/content-learning.php' ); | |
| 1080 | - } | |
| 1081 | -} | |
| 549 | +//if ( ! function_exists( 'learn_press_output_single_course_learning_summary' ) ) { | |
| 550 | +// /** | |
| 551 | +// * Output the content of learning course content | |
| 552 | +// */ | |
| 553 | +// function learn_press_output_single_course_learning_summary() { | |
| 554 | +// learn_press_get_template( 'single-course/content-learning.php' ); | |
| 555 | +// } | |
| 556 | +//} | |
| 1082 | 557 | |
| 1083 | 558 | |
| 1084 | -if ( ! function_exists( 'learn_press_output_single_course_landing_summary' ) ) { | |
| 1085 | - /** | |
| 1086 | - * Output the content of landing course content | |
| 1087 | - */ | |
| 1088 | - function learn_press_output_single_course_landing_summary() { | |
| 1089 | - learn_press_get_template( 'single-course/content-landing.php' ); | |
| 1090 | - } | |
| 1091 | -} | |
| 559 | +//if ( ! function_exists( 'learn_press_output_single_course_landing_summary' ) ) { | |
| 560 | +// /** | |
| 561 | +// * Output the content of landing course content | |
| 562 | +// */ | |
| 563 | +// function learn_press_output_single_course_landing_summary() { | |
| 564 | +// learn_press_get_template( 'single-course/content-landing.php' ); | |
| 565 | +// } | |
| 566 | +//} | |
| 1092 | 567 | |
| 1093 | 568 | |
| 1094 | 569 | |
| 1095 | -if ( ! function_exists( 'learn_press_course_title' ) ) { | |
| 1096 | - /** | |
| 1097 | - * Display the title for single course | |
| 1098 | - */ | |
| 1099 | - function learn_press_course_title() { | |
| 1100 | - learn_press_get_template( 'single-course/title.php' ); | |
| 1101 | - } | |
| 1102 | -} | |
| 570 | +//if ( ! function_exists( 'learn_press_course_title' ) ) { | |
| 571 | +// /** | |
| 572 | +// * Display the title for single course | |
| 573 | +// */ | |
| 574 | +// function learn_press_course_title() { | |
| 575 | +// learn_press_get_template( 'single-course/title.php' ); | |
| 576 | +// } | |
| 577 | +//} | |
| 1103 | 578 | |
| 1104 | 579 | if ( ! function_exists( 'learn_press_course_progress' ) ) { |
| 1105 | 580 | /** |
| 1106 | 581 | * Display course curriculum |
| 582 | + * @using ivy-school | |
| 1107 | 583 | */ |
| 1108 | 584 | function learn_press_course_progress() { |
| 1109 | 585 | learn_press_get_template( 'single-course/progress.php' ); |
| 1110 | 586 | } |
| @@ -1109,20 +585,21 @@ | ||
| 1109 | 585 | learn_press_get_template( 'single-course/progress.php' ); |
| 1110 | 586 | } |
| 1111 | 587 | } |
| 1112 | 588 | |
| 1113 | -if ( ! function_exists( 'learn_press_course_curriculum' ) ) { | |
| 1114 | - /** | |
| 1115 | - * Display course curriculum | |
| 1116 | - */ | |
| 1117 | - function learn_press_course_curriculum() { | |
| 1118 | - // learn_press_get_template( 'single-course/curriculum.php' ); | |
| 1119 | - } | |
| 1120 | -} | |
| 589 | +//if ( ! function_exists( 'learn_press_course_curriculum' ) ) { | |
| 590 | +// /** | |
| 591 | +// * Display course curriculum | |
| 592 | +// */ | |
| 593 | +// function learn_press_course_curriculum() { | |
| 594 | +// // learn_press_get_template( 'single-course/curriculum.php' ); | |
| 595 | +// } | |
| 596 | +//} | |
| 1121 | 597 | |
| 1122 | 598 | if ( ! function_exists( 'learn_press_course_categories' ) ) { |
| 1123 | 599 | /** |
| 1124 | 600 | * Display course categories |
| 601 | + * @using eduma child theme v5.5.5 | |
| 1125 | 602 | */ |
| 1126 | 603 | function learn_press_course_categories() { |
| 1127 | 604 | // learn_press_get_template( 'single-course/categories.php' ); |
| 1128 | 605 | } |
| @@ -1127,20 +604,21 @@ | ||
| 1127 | 604 | // learn_press_get_template( 'single-course/categories.php' ); |
| 1128 | 605 | } |
| 1129 | 606 | } |
| 1130 | 607 | |
| 1131 | -if ( ! function_exists( 'learn_press_course_tags' ) ) { | |
| 1132 | - /** | |
| 1133 | - * Display course tags | |
| 1134 | - */ | |
| 1135 | - function learn_press_course_tags() { | |
| 1136 | - learn_press_get_template( 'single-course/tags.php' ); | |
| 1137 | - } | |
| 1138 | -} | |
| 608 | +//if ( ! function_exists( 'learn_press_course_tags' ) ) { | |
| 609 | +// /** | |
| 610 | +// * Display course tags | |
| 611 | +// */ | |
| 612 | +// function learn_press_course_tags() { | |
| 613 | +// learn_press_get_template( 'single-course/tags.php' ); | |
| 614 | +// } | |
| 615 | +//} | |
| 1139 | 616 | |
| 1140 | 617 | if ( ! function_exists( 'learn_press_course_instructor' ) ) { |
| 1141 | 618 | /** |
| 1142 | 619 | * Display course instructor |
| 620 | + * @using in many themes. | |
| 1143 | 621 | */ |
| 1144 | 622 | function learn_press_course_instructor() { |
| 1145 | 623 | learn_press_get_template( 'single-course/instructor.php' ); |
| 1146 | 624 | } |
| @@ -1145,21 +623,12 @@ | ||
| 1145 | 623 | learn_press_get_template( 'single-course/instructor.php' ); |
| 1146 | 624 | } |
| 1147 | 625 | } |
| 1148 | 626 | |
| 1149 | -if ( ! function_exists( 'learn_press_course_buttons' ) ) { | |
| 1150 | - /** | |
| 1151 | - * Display course retake button | |
| 1152 | - */ | |
| 1153 | - function learn_press_course_buttons() { | |
| 1154 | - // learn_press_get_template( 'single-course/buttons.php' ); | |
| 1155 | - } | |
| 1156 | -} | |
| 1157 | - | |
| 1158 | - | |
| 1159 | 627 | if ( ! function_exists( 'learn_press_course_thumbnail' ) ) { |
| 1160 | 628 | /** |
| 1161 | 629 | * Display Course Thumbnail |
| 630 | + * @using in Eduma, Education Pack themes. | |
| 1162 | 631 | */ |
| 1163 | 632 | function learn_press_course_thumbnail() { |
| 1164 | 633 | learn_press_get_template( 'single-course/thumbnail.php' ); |
| 1165 | 634 | } |
| @@ -1164,770 +633,229 @@ | ||
| 1164 | 633 | learn_press_get_template( 'single-course/thumbnail.php' ); |
| 1165 | 634 | } |
| 1166 | 635 | } |
| 1167 | 636 | |
| 1168 | -if ( ! function_exists( 'learn_press_single_course_description' ) ) { | |
| 1169 | - /** | |
| 1170 | - * Display course description | |
| 1171 | - */ | |
| 1172 | - function learn_press_single_course_description() { | |
| 1173 | - learn_press_get_template( 'single-course/description.php' ); | |
| 1174 | - } | |
| 1175 | -} | |
| 637 | +//if ( ! function_exists( 'learn_press_single_course_description' ) ) { | |
| 638 | +// /** | |
| 639 | +// * Display course description | |
| 640 | +// */ | |
| 641 | +// function learn_press_single_course_description() { | |
| 642 | +// learn_press_get_template( 'single-course/description.php' ); | |
| 643 | +// } | |
| 644 | +//} | |
| 1176 | 645 | |
| 1177 | -if ( ! function_exists( 'learn_press_single_course_lesson_content' ) ) { | |
| 1178 | - /** | |
| 1179 | - * Display lesson content | |
| 1180 | - */ | |
| 1181 | - function learn_press_single_course_content_lesson() { | |
| 1182 | - // learn_press_get_template( 'single-course/content-lesson.php' ); | |
| 1183 | - } | |
| 1184 | -} | |
| 646 | +//if ( ! function_exists( 'learn_press_single_course_content_item' ) ) { | |
| 647 | +// /** | |
| 648 | +// * Display lesson content | |
| 649 | +// */ | |
| 650 | +// function learn_press_single_course_content_item() { | |
| 651 | +// learn_press_get_template( 'single-course/content-item.php' ); | |
| 652 | +// } | |
| 653 | +//} | |
| 1185 | 654 | |
| 1186 | -if ( ! function_exists( 'learn_press_single_course_content_item' ) ) { | |
| 1187 | - /** | |
| 1188 | - * Display lesson content | |
| 1189 | - */ | |
| 1190 | - function learn_press_single_course_content_item() { | |
| 1191 | - learn_press_get_template( 'single-course/content-item.php' ); | |
| 1192 | - } | |
| 1193 | -} | |
| 655 | +//if ( ! function_exists( 'learn_press_checkout_user_form_login' ) ) { | |
| 656 | +// /** | |
| 657 | +// * Output login form before order review if user is not logged in | |
| 658 | +// */ | |
| 659 | +// function learn_press_checkout_user_form_login() { | |
| 660 | +// learn_press_get_template( 'checkout/form-login.php' ); | |
| 661 | +// } | |
| 662 | +//} | |
| 1194 | 663 | |
| 664 | +//if ( ! function_exists( 'learn_press_checkout_user_form_register' ) ) { | |
| 665 | +// /** | |
| 666 | +// * Output register form before order review if user is not logged in | |
| 667 | +// */ | |
| 668 | +// function learn_press_checkout_user_form_register() { | |
| 669 | +// learn_press_get_template( 'checkout/form-register.php' ); | |
| 670 | +// } | |
| 671 | +//} | |
| 1195 | 672 | |
| 1196 | -if ( ! function_exists( 'learn_press_checkout_user_form' ) ) { | |
| 1197 | - /** | |
| 1198 | - * Output login/register form before order review if user is not logged in | |
| 1199 | - */ | |
| 1200 | - function learn_press_checkout_user_form() { | |
| 1201 | - // learn_press_get_template( 'checkout/user-form.php' ); | |
| 1202 | - } | |
| 1203 | -} | |
| 673 | +//if ( ! function_exists( 'learn_press_checkout_user_logged_in' ) ) { | |
| 674 | +// /** | |
| 675 | +// * Output message before order review if user is logged in | |
| 676 | +// */ | |
| 677 | +// function learn_press_checkout_user_logged_in() { | |
| 678 | +// learn_press_get_template( 'checkout/form-logged-in.php' ); | |
| 679 | +// } | |
| 680 | +//} | |
| 1204 | 681 | |
| 1205 | -if ( ! function_exists( 'learn_press_checkout_user_form_login' ) ) { | |
| 1206 | - /** | |
| 1207 | - * Output login form before order review if user is not logged in | |
| 1208 | - */ | |
| 1209 | - function learn_press_checkout_user_form_login() { | |
| 1210 | - learn_press_get_template( 'checkout/form-login.php' ); | |
| 1211 | - } | |
| 1212 | -} | |
| 1213 | 682 | |
| 1214 | -if ( ! function_exists( 'learn_press_checkout_user_form_register' ) ) { | |
| 1215 | - /** | |
| 1216 | - * Output register form before order review if user is not logged in | |
| 1217 | - */ | |
| 1218 | - function learn_press_checkout_user_form_register() { | |
| 1219 | - learn_press_get_template( 'checkout/form-register.php' ); | |
| 1220 | - } | |
| 1221 | -} | |
| 683 | +//if ( ! function_exists( 'learn_press_after_profile_tab_loop_course' ) ) { | |
| 684 | +// /** | |
| 685 | +// * Display user profile tabs | |
| 686 | +// * | |
| 687 | +// * @param LP_User | |
| 688 | +// */ | |
| 689 | +// function learn_press_after_profile_tab_loop_course( $user, $course_id ) { | |
| 690 | +// | |
| 691 | +// $args = array( | |
| 692 | +// 'user' => $user, | |
| 693 | +// 'course_id' => $course_id, | |
| 694 | +// ); | |
| 695 | +// learn_press_get_template( 'profile/tabs/courses/progress.php', $args ); | |
| 696 | +// } | |
| 697 | +//} | |
| 1222 | 698 | |
| 1223 | -if ( ! function_exists( 'learn_press_checkout_user_logged_in' ) ) { | |
| 1224 | - /** | |
| 1225 | - * Output message before order review if user is logged in | |
| 1226 | - */ | |
| 1227 | - function learn_press_checkout_user_logged_in() { | |
| 1228 | - learn_press_get_template( 'checkout/form-logged-in.php' ); | |
| 1229 | - } | |
| 1230 | -} | |
| 1231 | 699 | |
| 700 | +//if ( ! function_exists( 'learn_press_output_user_profile_info' ) ) { | |
| 701 | +// /** | |
| 702 | +// * Displaying user info | |
| 703 | +// * | |
| 704 | +// * @param $user | |
| 705 | +// */ | |
| 706 | +// function learn_press_output_user_profile_info( $user, $current, $tabs ) { | |
| 707 | +// learn_press_get_template( | |
| 708 | +// 'profile/info.php', | |
| 709 | +// array( | |
| 710 | +// 'user' => $user, | |
| 711 | +// 'tabs' => $tabs, | |
| 712 | +// 'current' => $current, | |
| 713 | +// ) | |
| 714 | +// ); | |
| 715 | +// } | |
| 716 | +//} | |
| 1232 | 717 | |
| 1233 | -if ( ! function_exists( 'learn_press_after_profile_tab_loop_course' ) ) { | |
| 1234 | - /** | |
| 1235 | - * Display user profile tabs | |
| 1236 | - * | |
| 1237 | - * @param LP_User | |
| 1238 | - */ | |
| 1239 | - function learn_press_after_profile_tab_loop_course( $user, $course_id ) { | |
| 1240 | - | |
| 1241 | - $args = array( | |
| 1242 | - 'user' => $user, | |
| 1243 | - 'course_id' => $course_id, | |
| 1244 | - ); | |
| 1245 | - learn_press_get_template( 'profile/tabs/courses/progress.php', $args ); | |
| 1246 | - | |
| 1247 | - } | |
| 1248 | -} | |
| 1249 | - | |
| 1250 | - | |
| 1251 | -if ( ! function_exists( 'learn_press_output_user_profile_info' ) ) { | |
| 1252 | - /** | |
| 1253 | - * Displaying user info | |
| 1254 | - * | |
| 1255 | - * @param $user | |
| 1256 | - */ | |
| 1257 | - function learn_press_output_user_profile_info( $user, $current, $tabs ) { | |
| 1258 | - learn_press_get_template( | |
| 1259 | - 'profile/info.php', | |
| 1260 | - array( | |
| 1261 | - 'user' => $user, | |
| 1262 | - 'tabs' => $tabs, | |
| 1263 | - 'current' => $current, | |
| 1264 | - ) | |
| 1265 | - ); | |
| 1266 | - } | |
| 1267 | -} | |
| 1268 | - | |
| 1269 | 718 | /* QUIZ TEMPLATES */ |
| 1270 | -if ( ! function_exists( 'learn_press_single_quiz_title' ) ) { | |
| 1271 | - /** | |
| 1272 | - * Output the title of the quiz | |
| 1273 | - */ | |
| 1274 | - function learn_press_single_quiz_title() { | |
| 1275 | - learn_press_get_template( 'content-quiz/title.php' ); | |
| 1276 | - } | |
| 1277 | -} | |
| 719 | +//if ( ! function_exists( 'learn_press_single_quiz_title' ) ) { | |
| 720 | +// /** | |
| 721 | +// * Output the title of the quiz | |
| 722 | +// */ | |
| 723 | +// function learn_press_single_quiz_title() { | |
| 724 | +// learn_press_get_template( 'content-quiz/title.php' ); | |
| 725 | +// } | |
| 726 | +//} | |
| 1278 | 727 | |
| 728 | +//if ( ! function_exists( 'learn_press_message' ) ) { | |
| 729 | +// /** | |
| 730 | +// * Template to display the messages | |
| 731 | +// * | |
| 732 | +// * @param $content | |
| 733 | +// * @param string $type | |
| 734 | +// */ | |
| 735 | +// function learn_press_message( $content, $type = 'message' ) { | |
| 736 | +// learn_press_get_template( | |
| 737 | +// 'global/message.php', | |
| 738 | +// array( | |
| 739 | +// 'type' => $type, | |
| 740 | +// 'content' => $content, | |
| 741 | +// ) | |
| 742 | +// ); | |
| 743 | +// } | |
| 744 | +//} | |
| 1279 | 745 | |
| 1280 | -if ( ! function_exists( 'learn_press_course_loop_item_buttons' ) ) { | |
| 1281 | - /** | |
| 1282 | - * @deprecated | |
| 1283 | - * | |
| 1284 | - * @since 3.3.0 | |
| 1285 | - * | |
| 1286 | - * @return bool | |
| 1287 | - */ | |
| 1288 | - function learn_press_course_loop_item_buttons() { | |
| 746 | +//if ( ! function_exists( 'learn_press_course_overview_tab' ) ) { | |
| 747 | +// /** | |
| 748 | +// * Output course overview | |
| 749 | +// * | |
| 750 | +// * @since 1.1 | |
| 751 | +// */ | |
| 752 | +// function learn_press_course_overview_tab() { | |
| 753 | +// learn_press_get_template( 'single-course/tabs/overview.php' ); | |
| 754 | +// } | |
| 755 | +//} | |
| 1289 | 756 | |
| 1290 | - return false; | |
| 1291 | - // learn_press_get_template( 'single-course/buttons.php' ); | |
| 1292 | - } | |
| 1293 | -} | |
| 757 | +//if ( ! function_exists( 'learn_press_course_curriculum_tab' ) ) { | |
| 758 | +// /** | |
| 759 | +// * Output course curriculum | |
| 760 | +// * | |
| 761 | +// * @since 1.1 | |
| 762 | +// */ | |
| 763 | +// function learn_press_course_curriculum_tab() { | |
| 764 | +// learn_press_get_template( 'single-course/tabs/curriculum.php' ); | |
| 765 | +// } | |
| 766 | +//} | |
| 1294 | 767 | |
| 768 | +//if ( ! function_exists( 'learn_press_course_instructor_tab' ) ) { | |
| 769 | +// /** | |
| 770 | +// * Output course curriculum | |
| 771 | +// * | |
| 772 | +// * @since 1.1 | |
| 773 | +// */ | |
| 774 | +// function learn_press_course_instructor_tab() { | |
| 775 | +// learn_press_get_template( 'single-course/tabs/instructor.php' ); | |
| 776 | +// } | |
| 777 | +//} | |
| 1295 | 778 | |
| 1296 | -if ( ! function_exists( 'learn_press_message' ) ) { | |
| 1297 | - /** | |
| 1298 | - * Template to display the messages | |
| 1299 | - * | |
| 1300 | - * @param $content | |
| 1301 | - * @param string $type | |
| 1302 | - */ | |
| 1303 | - function learn_press_message( $content, $type = 'message' ) { | |
| 1304 | - learn_press_get_template( | |
| 1305 | - 'global/message.php', | |
| 1306 | - array( | |
| 1307 | - 'type' => $type, | |
| 1308 | - 'content' => $content, | |
| 1309 | - ) | |
| 1310 | - ); | |
| 1311 | - } | |
| 1312 | -} | |
| 1313 | 779 | |
| 1314 | -if ( ! function_exists( 'learn_press_course_overview_tab' ) ) { | |
| 1315 | - /** | |
| 1316 | - * Output course overview | |
| 1317 | - * | |
| 1318 | - * @since 1.1 | |
| 1319 | - */ | |
| 1320 | - function learn_press_course_overview_tab() { | |
| 1321 | - learn_press_get_template( 'single-course/tabs/overview.php' ); | |
| 1322 | - } | |
| 1323 | -} | |
| 780 | +//if ( ! function_exists( 'learn_press_content_item_header' ) ) { | |
| 781 | +// function learn_press_content_item_header() { | |
| 782 | +// learn_press_get_template( 'single-course/content-item/header.php' ); | |
| 783 | +// } | |
| 784 | +//} | |
| 1324 | 785 | |
| 1325 | -if ( ! function_exists( 'learn_press_course_curriculum_tab' ) ) { | |
| 1326 | - /** | |
| 1327 | - * Output course curriculum | |
| 1328 | - * | |
| 1329 | - * @since 1.1 | |
| 1330 | - */ | |
| 1331 | - function learn_press_course_curriculum_tab() { | |
| 1332 | - learn_press_get_template( 'single-course/tabs/curriculum.php' ); | |
| 1333 | - } | |
| 1334 | -} | |
| 786 | +//if ( ! function_exists( 'learn_press_content_item_footer' ) ) { | |
| 787 | +// function learn_press_content_item_footer() { | |
| 788 | +// learn_press_get_template( 'single-course/content-item/footer.php' ); | |
| 789 | +// } | |
| 790 | +//} | |
| 1335 | 791 | |
| 1336 | -if ( ! function_exists( 'learn_press_course_instructor_tab' ) ) { | |
| 1337 | - /** | |
| 1338 | - * Output course curriculum | |
| 1339 | - * | |
| 1340 | - * @since 1.1 | |
| 1341 | - */ | |
| 1342 | - function learn_press_course_instructor_tab() { | |
| 1343 | - learn_press_get_template( 'single-course/tabs/instructor.php' ); | |
| 1344 | - } | |
| 1345 | -} | |
| 1346 | 792 | |
| 793 | +//if ( ! function_exists( 'learn_press_profile_mobile_menu' ) ) { | |
| 794 | +// function learn_press_profile_mobile_menu() { | |
| 795 | +// learn_press_get_template( 'profile/mobile-menu.php' ); | |
| 796 | +// } | |
| 797 | +//} | |
| 1347 | 798 | |
| 1348 | -if ( ! function_exists( 'learn_press_content_item_header' ) ) { | |
| 1349 | - function learn_press_content_item_header() { | |
| 1350 | - learn_press_get_template( 'single-course/content-item/header.php' ); | |
| 1351 | - } | |
| 1352 | -} | |
| 799 | +//if ( ! function_exists( 'learn_press_quiz_complete_button' ) ) { | |
| 800 | +// | |
| 801 | +// function learn_press_quiz_complete_button() { | |
| 802 | +// $course = learn_press_get_course(); | |
| 803 | +// $user = learn_press_get_current_user(); | |
| 804 | +// $quiz = LP_Global::course_item_quiz(); | |
| 805 | +// | |
| 806 | +// if ( $user->has_course_status( $course->get_id(), array( 'finished' ) ) || ! $user->has_quiz_status( 'started', $quiz->get_id(), $course->get_id() ) ) { | |
| 807 | +// return; | |
| 808 | +// } | |
| 809 | +// learn_press_get_template( 'content-quiz/buttons/complete.php' ); | |
| 810 | +// } | |
| 811 | +//} | |
| 1353 | 812 | |
| 1354 | -if ( ! function_exists( 'learn_press_content_item_footer' ) ) { | |
| 1355 | - function learn_press_content_item_footer() { | |
| 1356 | - learn_press_get_template( 'single-course/content-item/footer.php' ); | |
| 1357 | - } | |
| 1358 | -} | |
| 813 | +//if ( ! function_exists( 'learn_press_content_item_summary_question_explanation' ) ) { | |
| 814 | +// | |
| 815 | +// /** | |
| 816 | +// * Render content if quiz question. | |
| 817 | +// */ | |
| 818 | +// function learn_press_content_item_summary_question_explanation() { | |
| 819 | +// $quiz = LP_Global::course_item_quiz(); | |
| 820 | +// $question = $quiz->get_viewing_question(); | |
| 821 | +// if ( $question ) { | |
| 822 | +// $course = learn_press_get_course(); | |
| 823 | +// $user = learn_press_get_current_user(); | |
| 824 | +// $course_data = $user->get_course_data( $course->get_id() ); | |
| 825 | +// $user_quiz = $course_data->get_item_quiz( $quiz->get_id() ); | |
| 826 | +// | |
| 827 | +// if ( ! $question->get_explanation() ) { | |
| 828 | +// return; | |
| 829 | +// } | |
| 830 | +// | |
| 831 | +// if ( $user_quiz->has_checked_question( $question->get_id() ) || $user_quiz->is_answered_true( $question->get_id() ) ) { | |
| 832 | +// learn_press_get_template( 'content-question/explanation.php', array( 'question' => $question ) ); | |
| 833 | +// } | |
| 834 | +// } | |
| 835 | +// } | |
| 836 | +//} | |
| 1359 | 837 | |
| 1360 | - | |
| 1361 | -if ( ! function_exists( 'learn_press_profile_mobile_menu' ) ) { | |
| 1362 | - function learn_press_profile_mobile_menu() { | |
| 1363 | - learn_press_get_template( 'profile/mobile-menu.php' ); | |
| 1364 | - } | |
| 1365 | -} | |
| 1366 | - | |
| 1367 | -/** | |
| 1368 | - * Redirect back to course if the order have one course in that | |
| 1369 | - * | |
| 1370 | - * @param $results | |
| 1371 | - * @param $order_id | |
| 1372 | - * | |
| 1373 | - * @return mixed | |
| 1374 | - * @depecated 4.1.6.9 | |
| 1375 | - */ | |
| 1376 | -/*function _learn_press_checkout_success_result( $results, $order_id ) { | |
| 1377 | - if ( $results['result'] == 'success' ) { | |
| 1378 | - if ( $order = learn_press_get_order( $order_id ) ) { | |
| 1379 | - $items = $order->get_items(); | |
| 1380 | - $enrolled_course_id = learn_press_auto_enroll_user_to_courses( $order_id ); | |
| 1381 | - $course_id = 0; | |
| 1382 | - if ( sizeof( $items ) == 1 ) { | |
| 1383 | - $item = reset( $items ); | |
| 1384 | - $course_id = $item['course_id']; | |
| 1385 | - $results['redirect'] = get_the_permalink( $course_id ); | |
| 1386 | - } | |
| 1387 | - if ( ! $course_id ) { | |
| 1388 | - $course_id = $enrolled_course_id; | |
| 1389 | - } | |
| 1390 | - | |
| 1391 | - if ( $course = learn_press_get_course( $course_id ) ) { | |
| 1392 | - learn_press_add_message( sprintf( __( 'Congrats! You\'ve enrolled the course "%s".', 'learnpress' ), $course->get_title() ) ); | |
| 1393 | - } | |
| 1394 | - } | |
| 1395 | - } | |
| 1396 | - | |
| 1397 | - return $results; | |
| 1398 | -}*/ | |
| 1399 | - | |
| 1400 | -/** | |
| 1401 | - * @depecated 4.1.6.9 | |
| 1402 | - */ | |
| 1403 | -/*if ( ! function_exists( 'learn_press_content_item_summary_question_hint' ) ) { | |
| 1404 | - function learn_press_content_item_summary_question_hint() { | |
| 1405 | - $quiz = LP_Global::course_item_quiz(); | |
| 1406 | - if ( $question = $quiz->get_viewing_question() ) { | |
| 1407 | - $course = learn_press_get_course(); | |
| 1408 | - $user = learn_press_get_current_user(); | |
| 1409 | - $course_data = $user->get_course_data( $course->get_id() ); | |
| 1410 | - $user_quiz = $course_data->get_item_quiz( $quiz->get_id() ); | |
| 1411 | - | |
| 1412 | - if ( ! $question->get_hint() || ! $user_quiz->has_hinted_question( $question->get_id() ) || $user_quiz->has_checked_question( $question->get_id() ) ) { | |
| 1413 | - return; | |
| 1414 | - } | |
| 1415 | - | |
| 1416 | - learn_press_get_template( 'content-question/hint.php', array( 'question' => $question ) ); | |
| 1417 | - } | |
| 1418 | - | |
| 1419 | - } | |
| 1420 | -}*/ | |
| 1421 | - | |
| 1422 | -/** | |
| 1423 | - * @depecated 4.1.6.9 | |
| 1424 | - */ | |
| 1425 | -/*if ( ! function_exists( 'learn_press_content_item_summary_questions' ) ) { | |
| 1426 | - function learn_press_content_item_summary_questions() { | |
| 1427 | - return; | |
| 1428 | - $quiz = LP_Global::course_item_quiz(); | |
| 1429 | - if ( $questions = $quiz->get_questions() ) { | |
| 1430 | - $course = learn_press_get_course(); | |
| 1431 | - $user = learn_press_get_current_user(); | |
| 1432 | - $course_data = $user->get_course_data( $course->get_id() ); | |
| 1433 | - $quiz_data = $course_data->get_item_quiz( $quiz->get_id() ); | |
| 1434 | - global $lp_quiz_question; | |
| 1435 | - foreach ( $questions as $question_id ) { | |
| 1436 | - $question = LP_Question::get_question( $question_id ); | |
| 1437 | - $lp_quiz_question = $question; | |
| 1438 | - | |
| 1439 | - learn_press_get_template( 'content-question/title.php' ); | |
| 1440 | - learn_press_get_template( 'content-question/description.php' ); | |
| 1441 | - $question->render( $quiz_data->get_question_answer( $question->get_id() ) ); | |
| 1442 | - // learn_press_get_template('single-course/content-item-lp_quiz.php'); | |
| 1443 | - } | |
| 1444 | - } | |
| 1445 | - } | |
| 1446 | -}*/ | |
| 1447 | - | |
| 1448 | -/** | |
| 1449 | - * @depecated 4.1.6.9 | |
| 1450 | - */ | |
| 1451 | -/*if ( ! function_exists( 'learn_press_content_item_summary_question_numbers' ) ) { | |
| 1452 | - | |
| 1453 | - function learn_press_content_item_summary_question_numbers() { | |
| 1454 | - $course = learn_press_get_course(); | |
| 1455 | - $user = learn_press_get_current_user(); | |
| 1456 | - $quiz = LP_Global::course_item_quiz(); | |
| 1457 | - | |
| 1458 | - if ( ! $quiz->get_show_hide_question() ) { | |
| 1459 | - return; | |
| 1460 | - } | |
| 1461 | - | |
| 1462 | - if ( ! $user->has_quiz_status( array( 'started', 'completed' ), $quiz->get_id(), $course->get_id() ) ) { | |
| 1463 | - return; | |
| 1464 | - } | |
| 1465 | - | |
| 1466 | - if ( ! $quiz->get_viewing_question() ) { | |
| 1467 | - return; | |
| 1468 | - } | |
| 1469 | - learn_press_get_template( 'content-quiz/question-numbers.php' ); | |
| 1470 | - } | |
| 1471 | -}*/ | |
| 1472 | - | |
| 1473 | -/** | |
| 1474 | - * @depecated 4.1.6.9 | |
| 1475 | - */ | |
| 1476 | -/*if ( ! function_exists( 'learn_press_quiz_nav_buttons' ) ) { | |
| 1477 | - | |
| 1478 | - function learn_press_quiz_nav_buttons() { | |
| 1479 | - $course = learn_press_get_course(); | |
| 1480 | - $user = learn_press_get_current_user(); | |
| 1481 | - $quiz = LP_Global::course_item_quiz(); | |
| 1482 | - | |
| 1483 | - if ( ! $user->has_quiz_status( array( 'started', 'completed' ), $quiz->get_id(), $course->get_id() ) ) { | |
| 1484 | - return; | |
| 1485 | - } | |
| 1486 | - | |
| 1487 | - if ( ! $quiz->get_viewing_question() ) { | |
| 1488 | - return; | |
| 1489 | - } | |
| 1490 | - | |
| 1491 | - learn_press_get_template( 'content-quiz/buttons/nav.php' ); | |
| 1492 | - } | |
| 1493 | -}*/ | |
| 1494 | - | |
| 1495 | -/** | |
| 1496 | - * @depecated 4.1.6.9 | |
| 1497 | - */ | |
| 1498 | -/*if ( ! function_exists( 'learn_press_quiz_start_button' ) ) { | |
| 1499 | - | |
| 1500 | - function learn_press_quiz_start_button() { | |
| 1501 | - $course = learn_press_get_course(); | |
| 1502 | - $user = learn_press_get_current_user(); | |
| 1503 | - $quiz = LP_Global::course_item_quiz(); | |
| 1504 | - | |
| 1505 | - if ( $user->has_course_status( $course->get_id(), array( 'finished' ) ) || $user->has_quiz_status( | |
| 1506 | - array( | |
| 1507 | - 'started', | |
| 1508 | - 'completed', | |
| 1509 | - ), | |
| 1510 | - $quiz->get_id(), | |
| 1511 | - $course->get_id() | |
| 1512 | - ) | |
| 1513 | - ) { | |
| 1514 | - return; | |
| 1515 | - } | |
| 1516 | - learn_press_get_template( 'content-quiz/buttons/start.php' ); | |
| 1517 | - } | |
| 1518 | -}*/ | |
| 1519 | - | |
| 1520 | -/** | |
| 1521 | - * @depecated 4.1.6.9 | |
| 1522 | - */ | |
| 1523 | -/*if ( ! function_exists( 'learn_press_quiz_continue_button' ) ) { | |
| 1524 | - | |
| 1525 | - function learn_press_quiz_continue_button() { | |
| 1526 | - $course = learn_press_get_course(); | |
| 1527 | - $user = learn_press_get_current_user(); | |
| 1528 | - $quiz = LP_Global::course_item_quiz(); | |
| 1529 | - | |
| 1530 | - if ( ! $user->has_quiz_status( 'started', $quiz->get_id(), $course->get_id() ) ) { | |
| 1531 | - return; | |
| 1532 | - } | |
| 1533 | - | |
| 1534 | - if ( $quiz->get_viewing_question() ) { | |
| 1535 | - return; | |
| 1536 | - } | |
| 1537 | - | |
| 1538 | - learn_press_get_template( 'content-quiz/buttons/continue.php' ); | |
| 1539 | - } | |
| 1540 | -}*/ | |
| 1541 | - | |
| 1542 | -if ( ! function_exists( 'learn_press_quiz_complete_button' ) ) { | |
| 1543 | - | |
| 1544 | - function learn_press_quiz_complete_button() { | |
| 1545 | - $course = learn_press_get_course(); | |
| 1546 | - $user = learn_press_get_current_user(); | |
| 1547 | - $quiz = LP_Global::course_item_quiz(); | |
| 1548 | - | |
| 1549 | - if ( $user->has_course_status( $course->get_id(), array( 'finished' ) ) || ! $user->has_quiz_status( 'started', $quiz->get_id(), $course->get_id() ) ) { | |
| 1550 | - return; | |
| 1551 | - } | |
| 1552 | - learn_press_get_template( 'content-quiz/buttons/complete.php' ); | |
| 1553 | - } | |
| 1554 | -} | |
| 1555 | - | |
| 1556 | -if ( ! function_exists( 'learn_press_quiz_redo_button' ) ) { | |
| 1557 | - | |
| 1558 | - function learn_press_quiz_redo_button() { | |
| 1559 | - $course = learn_press_get_course(); | |
| 1560 | - $user = learn_press_get_current_user(); | |
| 1561 | - $quiz = LP_Global::course_item_quiz(); | |
| 1562 | - | |
| 1563 | - if ( ! $user->has_quiz_status( 'completed', $quiz->get_id(), $course->get_id() ) ) { | |
| 1564 | - return; | |
| 1565 | - } | |
| 1566 | - | |
| 1567 | - if ( $user->has_course_status( $course->get_id(), array( 'finished' ) ) || ! $user->can_retake_quiz( $quiz->get_id(), $course->get_id() ) ) { | |
| 1568 | - return; | |
| 1569 | - } | |
| 1570 | - | |
| 1571 | - learn_press_get_template( 'content-quiz/buttons/redo.php' ); | |
| 1572 | - } | |
| 1573 | -} | |
| 1574 | - | |
| 1575 | -/** | |
| 1576 | - * @depecated 4.1.6.9 | |
| 1577 | - */ | |
| 1578 | -/*if ( ! function_exists( 'learn_press_quiz_result_button' ) ) { | |
| 1579 | - | |
| 1580 | - function learn_press_quiz_result_button() { | |
| 1581 | - $course = learn_press_get_course(); | |
| 1582 | - $user = learn_press_get_current_user(); | |
| 1583 | - $quiz = LP_Global::course_item_quiz(); | |
| 1584 | - | |
| 1585 | - if ( ! $user->has_quiz_status( 'completed', $quiz->get_id(), $course->get_id() ) ) { | |
| 1586 | - return; | |
| 1587 | - } | |
| 1588 | - | |
| 1589 | - if ( LP_Global::quiz_question() ) { | |
| 1590 | - return; | |
| 1591 | - } | |
| 1592 | - | |
| 1593 | - if ( ! $quiz->get_review_questions() ) { | |
| 1594 | - return; | |
| 1595 | - } | |
| 1596 | - | |
| 1597 | - learn_press_get_template( 'content-quiz/buttons/review.php' ); | |
| 1598 | - } | |
| 1599 | -}*/ | |
| 1600 | - | |
| 1601 | -/** | |
| 1602 | - * @depecated 4.1.6.9 | |
| 1603 | - */ | |
| 1604 | -/*if ( ! function_exists( 'learn_press_quiz_summary_button' ) ) { | |
| 1605 | - | |
| 1606 | - function learn_press_quiz_summary_button() { | |
| 1607 | - $course = learn_press_get_course(); | |
| 1608 | - $user = learn_press_get_current_user(); | |
| 1609 | - $quiz = LP_Global::course_item_quiz(); | |
| 1610 | - | |
| 1611 | - if ( ! $user->has_quiz_status( 'completed', $quiz->get_id(), $course->get_id() ) ) { | |
| 1612 | - return; | |
| 1613 | - } | |
| 1614 | - | |
| 1615 | - if ( ! learn_press_is_review_questions() ) { | |
| 1616 | - return; | |
| 1617 | - } | |
| 1618 | - | |
| 1619 | - learn_press_get_template( 'content-quiz/buttons/summary.php' ); | |
| 1620 | - } | |
| 1621 | -}*/ | |
| 1622 | - | |
| 1623 | -/** | |
| 1624 | - * @depecated 4.1.6.9 | |
| 1625 | - */ | |
| 1626 | -/*if ( ! function_exists( 'learn_press_quiz_check_button' ) ) { | |
| 1627 | - | |
| 1628 | - function learn_press_quiz_check_button() { | |
| 1629 | - $course = learn_press_get_course(); | |
| 1630 | - $user = learn_press_get_current_user(); | |
| 1631 | - $quiz = LP_Global::course_item_quiz(); | |
| 1632 | - | |
| 1633 | - if ( ! $quiz->is_viewing_question() ) { | |
| 1634 | - return; | |
| 1635 | - } | |
| 1636 | - | |
| 1637 | - if ( ! $user->can_check_answer( $quiz->get_id(), $course->get_id() ) ) { | |
| 1638 | - return; | |
| 1639 | - } | |
| 1640 | - | |
| 1641 | - if ( $user->has_course_status( $course->get_id(), array( 'finished' ) ) || ! $user->has_quiz_status( 'started', $quiz->get_id(), $course->get_id() ) ) { | |
| 1642 | - return; | |
| 1643 | - } | |
| 1644 | - | |
| 1645 | - learn_press_get_template( 'content-quiz/buttons/check.php' ); | |
| 1646 | - } | |
| 1647 | -}*/ | |
| 1648 | - | |
| 1649 | -/** | |
| 1650 | - * @depecated 4.1.6.9 | |
| 1651 | - */ | |
| 1652 | -/*if ( ! function_exists( 'learn_press_quiz_hint_button' ) ) { | |
| 1653 | - | |
| 1654 | - function learn_press_quiz_hint_button() { | |
| 1655 | - $course = learn_press_get_course(); | |
| 1656 | - $user = learn_press_get_current_user(); | |
| 1657 | - $quiz = LP_Global::course_item_quiz(); | |
| 1658 | - $question = LP_Global::quiz_question(); | |
| 1659 | - | |
| 1660 | - if ( ! $quiz->is_viewing_question() ) { | |
| 1661 | - return; | |
| 1662 | - } | |
| 1663 | - | |
| 1664 | - if ( ! $question->get_hint() ) { | |
| 1665 | - return; | |
| 1666 | - } | |
| 1667 | - | |
| 1668 | - if ( ! $user->can_hint_answer( $quiz->get_id(), $course->get_id() ) ) { | |
| 1669 | - return; | |
| 1670 | - } | |
| 1671 | - | |
| 1672 | - if ( ! $user->has_quiz_status( 'started', $quiz->get_id(), $course->get_id() ) ) { | |
| 1673 | - return; | |
| 1674 | - } | |
| 1675 | - | |
| 1676 | - $quiz_item = $user->get_quiz_data( $quiz->get_id(), $course->get_id() ); | |
| 1677 | - | |
| 1678 | - if ( $quiz_item && ( $quiz_item->has_checked_question( $question->get_id() ) || $quiz_item->is_answered( $question->get_id() ) ) ) { | |
| 1679 | - return; | |
| 1680 | - } | |
| 1681 | - | |
| 1682 | - learn_press_get_template( 'content-quiz/buttons/hint.php' ); | |
| 1683 | - } | |
| 1684 | -}*/ | |
| 1685 | - | |
| 1686 | -/** | |
| 1687 | - * @depecated 4.1.6.9 | |
| 1688 | - */ | |
| 1689 | -/*if ( ! function_exists( 'learn_press_profile_order_details' ) ) { | |
| 1690 | - function learn_press_profile_order_details() { | |
| 1691 | - $profile = LP_Profile::instance(); | |
| 1692 | - $order = $profile->get_view_order(); | |
| 1693 | - if ( false === $order ) { | |
| 1694 | - return; | |
| 1695 | - } | |
| 1696 | - | |
| 1697 | - learn_press_get_template( 'order/order-details.php', array( 'order' => $order ) ); | |
| 1698 | - } | |
| 1699 | -}*/ | |
| 1700 | - | |
| 1701 | -/** | |
| 1702 | - * @depecated 4.1.6.9 | |
| 1703 | - */ | |
| 1704 | -/*if ( ! function_exists( 'learn_press_profile_order_recover' ) ) { | |
| 1705 | - function learn_press_profile_order_recover() { | |
| 1706 | - $profile = LP_Profile::instance(); | |
| 1707 | - $order = $profile->get_view_order(); | |
| 1708 | - if ( false === $order ) { | |
| 1709 | - return; | |
| 1710 | - } | |
| 1711 | - learn_press_get_template( 'profile/tabs/orders/recover-my-order.php', array( 'order' => $order ) ); | |
| 1712 | - } | |
| 1713 | -}*/ | |
| 1714 | - | |
| 1715 | -/** | |
| 1716 | - * @depecated 4.1.6.9 | |
| 1717 | - */ | |
| 1718 | -/*if ( ! function_exists( 'learn_press_profile_order_message' ) ) { | |
| 1719 | - function learn_press_profile_order_message() { | |
| 1720 | - $profile = LP_Profile::instance(); | |
| 1721 | - $order = $profile->get_view_order(); | |
| 1722 | - if ( false === $order ) { | |
| 1723 | - return; | |
| 1724 | - } | |
| 1725 | - learn_press_get_template( 'profile/tabs/orders/order-message.php', array( 'order' => $order ) ); | |
| 1726 | - } | |
| 1727 | -}*/ | |
| 1728 | - | |
| 1729 | -/** | |
| 1730 | - * @depecated 4.1.6.9 | |
| 1731 | - */ | |
| 1732 | -/*if ( ! function_exists( 'learn_press_profile_dashboard_logged_in' ) ) { | |
| 1733 | - function learn_press_profile_dashboard_logged_in() { | |
| 1734 | - learn_press_get_template( 'profile/dashboard-logged-in.php' ); | |
| 1735 | - } | |
| 1736 | -}*/ | |
| 1737 | - | |
| 1738 | -/** | |
| 1739 | - * @depecated 4.1.6.9 | |
| 1740 | - */ | |
| 1741 | -/*if ( ! function_exists( 'learn_press_profile_dashboard_user_bio' ) ) { | |
| 1742 | - function learn_press_profile_dashboard_user_bio() { | |
| 1743 | - $profile = LP_Profile::instance(); | |
| 1744 | - $user = $profile->get_user(); | |
| 1745 | - if ( ! $user ) { | |
| 1746 | - return; | |
| 1747 | - } | |
| 1748 | - | |
| 1749 | - learn_press_get_template( 'profile/user-bio.php' ); | |
| 1750 | - } | |
| 1751 | -}*/ | |
| 1752 | - | |
| 1753 | -if ( ! function_exists( 'learn_press_profile_dashboard_not_logged_in' ) ) { | |
| 1754 | - function learn_press_profile_dashboard_not_logged_in() { | |
| 1755 | - $profile = LP_Global::profile(); | |
| 1756 | - | |
| 1757 | - if ( ! $profile->get_user()->is_guest() ) { | |
| 1758 | - return; | |
| 1759 | - } | |
| 1760 | - | |
| 1761 | - if ( 'yes' === LP_Settings::instance()->get( 'enable_register_profile' ) || 'yes' === LP_Settings::instance()->get( 'enable_login_profile' ) ) { | |
| 1762 | - return; | |
| 1763 | - } | |
| 1764 | - | |
| 1765 | - learn_press_get_template( 'profile/not-logged-in.php' ); | |
| 1766 | - } | |
| 1767 | -} | |
| 1768 | - | |
| 1769 | -/** | |
| 1770 | - * @depecated 4.1.6.9 | |
| 1771 | - */ | |
| 1772 | -/*if ( ! function_exists( 'learn_press_profile_login_form' ) ) { | |
| 1773 | - function learn_press_profile_login_form() { | |
| 1774 | - $profile = LP_Global::profile(); | |
| 1775 | - | |
| 1776 | - print_r( metadata_exists( 'user', $profile->get_user()->get_id(), '_lp_temp_user' ) ); | |
| 1777 | - if ( ! $profile->get_user()->is_guest() ) { | |
| 1778 | - return; | |
| 1779 | - } | |
| 1780 | - $fields = $profile->get_login_fields(); | |
| 1781 | - if ( ! $fields ) { | |
| 1782 | - return; | |
| 1783 | - } | |
| 1784 | - | |
| 1785 | - if ( 'yes' !== LP_Settings::instance()->get( 'enable_login_profile' ) ) { | |
| 1786 | - return; | |
| 1787 | - } | |
| 1788 | - | |
| 1789 | - learn_press_get_template( 'global/form-login.php', array( 'fields' => $fields ) ); | |
| 1790 | - } | |
| 1791 | -}*/ | |
| 1792 | - | |
| 1793 | -/** | |
| 1794 | - * @depecated 4.1.6.9 | |
| 1795 | - */ | |
| 1796 | -/*if ( ! function_exists( 'learn_press_profile_register_form' ) ) { | |
| 1797 | - function learn_press_profile_register_form() { | |
| 1798 | - $profile = LP_Global::profile(); | |
| 1799 | - | |
| 1800 | - if ( ! $profile->get_user()->is_guest() ) { | |
| 1801 | - return; | |
| 1802 | - } | |
| 1803 | - $fields = $profile->get_register_fields(); | |
| 1804 | - if ( ! $fields ) { | |
| 1805 | - return; | |
| 1806 | - } | |
| 1807 | - | |
| 1808 | - if ( 'yes' !== LP_Settings::instance()->get( 'enable_register_profile' ) ) { | |
| 1809 | - return; | |
| 1810 | - } | |
| 1811 | - | |
| 1812 | - learn_press_get_template( 'global/form-register.php', array( 'fields' => $fields ) ); | |
| 1813 | - } | |
| 1814 | -}*/ | |
| 1815 | - | |
| 1816 | -/** | |
| 1817 | - * @depecated 4.1.6.9 | |
| 1818 | - */ | |
| 1819 | -/*if ( ! function_exists( 'learn_press_content_item_lesson_title' ) ) { | |
| 1820 | - function learn_press_content_item_lesson_title() { | |
| 1821 | - $item = LP_Global::course_item(); | |
| 1822 | - | |
| 1823 | - if ( ( 'standard' !== ( $format = $item->get_format() ) ) && file_exists( $format_template = learn_press_locate_template( "content-lesson/{$format}/title.php" ) ) ) { | |
| 1824 | - include $format_template; | |
| 1825 | - | |
| 1826 | - return; | |
| 1827 | - } | |
| 1828 | - learn_press_get_template( 'content-lesson/title.php' ); | |
| 1829 | - } | |
| 1830 | -}*/ | |
| 1831 | - | |
| 1832 | -/** | |
| 1833 | - * @depecated 4.1.6.9 | |
| 1834 | - */ | |
| 1835 | -/*if ( ! function_exists( 'learn_press_content_item_lesson_content' ) ) { | |
| 1836 | - function learn_press_content_item_lesson_content() { | |
| 1837 | - $item = LP_Global::course_item(); | |
| 1838 | - | |
| 1839 | - if ( $item->is_blocked() ) { | |
| 1840 | - return; | |
| 1841 | - } | |
| 1842 | - | |
| 1843 | - if ( ( 'standard' !== ( $format = $item->get_format() ) ) && file_exists( $format_template = learn_press_locate_template( "content-lesson/{$format}/content.php" ) ) ) { | |
| 1844 | - include $format_template; | |
| 1845 | - | |
| 1846 | - return; | |
| 1847 | - } | |
| 1848 | - do_action( 'learn-press/lesson-start', $item ); | |
| 1849 | - learn_press_get_template( 'content-lesson/content.php' ); | |
| 1850 | - } | |
| 1851 | -}*/ | |
| 1852 | - | |
| 1853 | -/** | |
| 1854 | - * @depecated 4.1.6.9 | |
| 1855 | - */ | |
| 1856 | -/*if ( ! function_exists( 'learn_press_content_item_lesson_content_blocked' ) ) { | |
| 1857 | - function learn_press_content_item_lesson_content_blocked() { | |
| 1858 | - $item = LP_Global::course_item(); | |
| 1859 | - | |
| 1860 | - if ( ! $item->is_blocked() ) { | |
| 1861 | - return; | |
| 1862 | - } | |
| 1863 | - | |
| 1864 | - learn_press_get_template( 'global/block-content.php' ); | |
| 1865 | - } | |
| 1866 | -}*/ | |
| 1867 | - | |
| 1868 | -/** | |
| 1869 | - * @depecated 4.1.6.9 | |
| 1870 | - */ | |
| 1871 | -/*if ( ! function_exists( 'learn_press_content_item_lesson_complete_button' ) ) { | |
| 1872 | - function learn_press_content_item_lesson_complete_button() { | |
| 1873 | - $user = learn_press_get_current_user(); | |
| 1874 | - $course = learn_press_get_course(); | |
| 1875 | - $lesson = LP_Global::course_item(); | |
| 1876 | - | |
| 1877 | - if ( ! $course->is_required_enroll() ) { | |
| 1878 | - return; | |
| 1879 | - } | |
| 1880 | - | |
| 1881 | - $course_item = $user->get_course_data( $course->get_id() ); | |
| 1882 | - if ( $course_item && $course_item->is_finished() ) { | |
| 1883 | - return; | |
| 1884 | - } | |
| 1885 | - | |
| 1886 | - learn_press_get_template( 'content-lesson/button-complete.php' ); | |
| 1887 | - } | |
| 1888 | -}*/ | |
| 1889 | - | |
| 1890 | -if ( ! function_exists( 'learn_press_content_item_summary_question_explanation' ) ) { | |
| 1891 | - | |
| 1892 | - /** | |
| 1893 | - * Render content if quiz question. | |
| 1894 | - */ | |
| 1895 | - function learn_press_content_item_summary_question_explanation() { | |
| 1896 | - $quiz = LP_Global::course_item_quiz(); | |
| 1897 | - $question = $quiz->get_viewing_question(); | |
| 1898 | - if ( $question ) { | |
| 1899 | - $course = learn_press_get_course(); | |
| 1900 | - $user = learn_press_get_current_user(); | |
| 1901 | - $course_data = $user->get_course_data( $course->get_id() ); | |
| 1902 | - $user_quiz = $course_data->get_item_quiz( $quiz->get_id() ); | |
| 1903 | - | |
| 1904 | - if ( ! $question->get_explanation() ) { | |
| 1905 | - return; | |
| 1906 | - } | |
| 1907 | - | |
| 1908 | - if ( $user_quiz->has_checked_question( $question->get_id() ) || $user_quiz->is_answered_true( $question->get_id() ) ) { | |
| 1909 | - learn_press_get_template( 'content-question/explanation.php', array( 'question' => $question ) ); | |
| 1910 | - } | |
| 1911 | - } | |
| 1912 | - } | |
| 1913 | -} | |
| 1914 | - | |
| 1915 | 838 | if ( ! function_exists( 'learn_press_breadcrumb' ) ) { |
| 1916 | 839 | /** |
| 1917 | 840 | * Output the breadcrumb of archive courses |
| 841 | + * Still using | |
| 1918 | 842 | * |
| 1919 | - * @param array | |
| 843 | + * @param array $args | |
| 844 | + * @deprecated still using addons collection, upsell, themes | |
| 1920 | 845 | */ |
| 1921 | 846 | function learn_press_breadcrumb( $args = array() ) { |
| 847 | + echo Template::html_breadcrumb( $args ); | |
| 848 | + return; | |
| 849 | + | |
| 1922 | 850 | $args = wp_parse_args( |
| 1923 | 851 | $args, |
| 1924 | 852 | apply_filters( |
| 1925 | 853 | 'learn_press_breadcrumb_defaults', |
| 1926 | 854 | array( |
| 1927 | - 'delimiter' => ' / ', | |
| 1928 | - 'wrap_before' => '<nav class="learn-press-breadcrumb">', | |
| 1929 | - 'wrap_after' => '</nav>', | |
| 855 | + 'delimiter' => '<li class="breadcrumb-delimiter"><i class="lp-icon-angle-right"></i></li>', | |
| 856 | + 'wrap_before' => '<ul class="learn-press-breadcrumb">', | |
| 857 | + 'wrap_after' => '</ul>', | |
| 1930 | 858 | 'before' => '', |
| 1931 | 859 | 'after' => '', |
| 1932 | 860 | 'home' => _x( 'Home', 'breadcrumb', 'learnpress' ), |
| 1933 | 861 | ) |
| @@ -1945,270 +873,223 @@ | ||
| 1945 | 873 | learn_press_get_template( 'global/breadcrumb.php', $args ); |
| 1946 | 874 | } |
| 1947 | 875 | } |
| 1948 | 876 | |
| 1949 | -if ( ! function_exists( 'learn_press_search_form' ) ) { | |
| 1950 | - /** | |
| 1951 | - * Output the breadcrumb of archive courses | |
| 1952 | - * | |
| 1953 | - * @param array | |
| 1954 | - */ | |
| 1955 | - function learn_press_search_form() { | |
| 1956 | - if ( ! empty( $_REQUEST['s'] ) && ! empty( $_REQUEST['ref'] ) && 'course' == $_REQUEST['ref'] ) { | |
| 1957 | - $s = stripslashes_deep( $_REQUEST['s'] ); | |
| 1958 | - } else { | |
| 1959 | - $s = ''; | |
| 1960 | - } | |
| 877 | +//if ( ! function_exists( 'learn_press_search_form' ) ) { | |
| 878 | +// /** | |
| 879 | +// * Output the breadcrumb of archive courses | |
| 880 | +// * | |
| 881 | +// * @param array | |
| 882 | +// */ | |
| 883 | +// function learn_press_search_form() { | |
| 884 | +// if ( ! empty( $_REQUEST['s'] ) && ! empty( $_REQUEST['ref'] ) && 'course' == $_REQUEST['ref'] ) { | |
| 885 | +// $s = stripslashes_deep( $_REQUEST['s'] ); | |
| 886 | +// } else { | |
| 887 | +// $s = ''; | |
| 888 | +// } | |
| 889 | +// | |
| 890 | +// learn_press_get_template( 'search-form.php', array( 's' => $s ) ); | |
| 891 | +// } | |
| 892 | +//} | |
| 1961 | 893 | |
| 1962 | - learn_press_get_template( 'search-form.php', array( 's' => $s ) ); | |
| 1963 | - } | |
| 1964 | -} | |
| 894 | +//if ( ! function_exists( 'learn_press_section_item_meta' ) ) { | |
| 895 | +// /** | |
| 896 | +// * @param object | |
| 897 | +// * @param array | |
| 898 | +// * @param LP_Course | |
| 899 | +// */ | |
| 900 | +// function learn_press_section_item_meta( $item, $section ) { | |
| 901 | +// learn_press_get_template( | |
| 902 | +// 'single-course/section/item-meta.php', | |
| 903 | +// array( | |
| 904 | +// 'item' => $item, | |
| 905 | +// 'section' => $section, | |
| 906 | +// ) | |
| 907 | +// ); | |
| 908 | +// } | |
| 909 | +//} | |
| 1965 | 910 | |
| 1966 | -/** | |
| 1967 | - * @depecated 4.1.6.9 | |
| 1968 | - */ | |
| 1969 | -/*if ( ! function_exists( 'learn_press_content_single_item' ) ) { | |
| 1970 | - function learn_press_content_single_item() { | |
| 1971 | - if ( $course_item = LP_Global::course_item() ) { | |
| 1972 | - // remove course comment form on singler item | |
| 1973 | - add_filter( 'comments_open', 'learn_press_course_comments_open', 10, 2 ); | |
| 1974 | - learn_press_get_template( 'content-single-item.php' ); | |
| 1975 | - } | |
| 1976 | - } | |
| 1977 | -}*/ | |
| 911 | +//if ( ! function_exists( 'learn_press_order_details_table' ) ) { | |
| 912 | +// | |
| 913 | +// /** | |
| 914 | +// * Displays order details in a table. | |
| 915 | +// * | |
| 916 | +// * @param mixed $order_id | |
| 917 | +// * | |
| 918 | +// * @subpackage Orders | |
| 919 | +// */ | |
| 920 | +// function learn_press_order_details_table( $order_id ) { | |
| 921 | +// if ( ! $order_id ) { | |
| 922 | +// return; | |
| 923 | +// } | |
| 924 | +// | |
| 925 | +// learn_press_get_template( | |
| 926 | +// 'order/order-details.php', | |
| 927 | +// array( | |
| 928 | +// 'order' => learn_press_get_order( $order_id ), | |
| 929 | +// ) | |
| 930 | +// ); | |
| 931 | +// } | |
| 932 | +//} | |
| 1978 | 933 | |
| 1979 | -/** | |
| 1980 | - * @depecated 4.1.6.9 | |
| 1981 | - */ | |
| 1982 | -/*if ( ! function_exists( 'learn_press_content_single_course' ) ) { | |
| 1983 | - function learn_press_content_single_course() { | |
| 1984 | 934 | |
| 1985 | - if ( ! $course_item = LP_Global::course_item() ) { | |
| 1986 | - learn_press_get_template( 'content-single-course.php' ); | |
| 1987 | - } | |
| 1988 | - } | |
| 1989 | -}*/ | |
| 935 | +//if ( ! function_exists( 'learn_press_profile_tab_courses_own' ) ) { | |
| 936 | +// /** | |
| 937 | +// * Display user profile tabs | |
| 938 | +// * | |
| 939 | +// * @param LP_User | |
| 940 | +// */ | |
| 941 | +// function learn_press_profile_tab_courses_own( $user, $tab = null ) { | |
| 942 | +// $args = array( | |
| 943 | +// 'user' => $user, | |
| 944 | +// 'subtab' => $tab, | |
| 945 | +// ); | |
| 946 | +// $limit = LP_Settings::instance()->get( 'profile_courses_limit', 10 ); | |
| 947 | +// $limit = apply_filters( 'learn_press_profile_tab_courses_own_limit', $limit ); | |
| 948 | +// $courses = $user->get( 'own-courses', array( 'limit' => $limit ) ); | |
| 949 | +// $num_pages = learn_press_get_num_pages( $user->_get_found_rows(), $limit ); | |
| 950 | +// $args['courses'] = $courses; | |
| 951 | +// $args['num_pages'] = $num_pages; | |
| 952 | +// learn_press_get_template( 'profile/tabs/courses/own.php', $args ); | |
| 953 | +// } | |
| 954 | +//} | |
| 1990 | 955 | |
| 1991 | 956 | |
| 957 | +//if ( ! function_exists( 'learn_press_profile_tab_courses_learning' ) ) { | |
| 958 | +// /** | |
| 959 | +// * Display user profile tabs | |
| 960 | +// * | |
| 961 | +// * @param LP_User | |
| 962 | +// */ | |
| 963 | +// function learn_press_profile_tab_courses_learning( $user, $tab = null ) { | |
| 964 | +// $args = array( | |
| 965 | +// 'user' => $user, | |
| 966 | +// 'subtab' => $tab, | |
| 967 | +// ); | |
| 968 | +// $limit = LP_Settings::instance()->get( 'profile_courses_limit', 10 ); | |
| 969 | +// $limit = apply_filters( 'learn_press_profile_tab_courses_learning_limit', $limit ); | |
| 970 | +// $courses = $user->get( | |
| 971 | +// 'enrolled-courses', | |
| 972 | +// array( | |
| 973 | +// 'status' => 'enrolled', | |
| 974 | +// 'limit' => $limit, | |
| 975 | +// ) | |
| 976 | +// ); | |
| 977 | +// $num_pages = learn_press_get_num_pages( $user->_get_found_rows(), $limit ); | |
| 978 | +// $args['courses'] = $courses; | |
| 979 | +// $args['num_pages'] = $num_pages; | |
| 980 | +// learn_press_get_template( 'profile/tabs/courses/learning.php', $args ); | |
| 981 | +// } | |
| 982 | +//} | |
| 1992 | 983 | |
| 1993 | -if ( ! function_exists( 'learn_press_section_item_meta' ) ) { | |
| 1994 | - /** | |
| 1995 | - * @param object | |
| 1996 | - * @param array | |
| 1997 | - * @param LP_Course | |
| 1998 | - */ | |
| 1999 | - function learn_press_section_item_meta( $item, $section ) { | |
| 2000 | - learn_press_get_template( | |
| 2001 | - 'single-course/section/item-meta.php', | |
| 2002 | - array( | |
| 2003 | - 'item' => $item, | |
| 2004 | - 'section' => $section, | |
| 2005 | - ) | |
| 2006 | - ); | |
| 2007 | - } | |
| 2008 | -} | |
| 984 | +//if ( ! function_exists( 'learn_press_profile_tab_courses_purchased' ) ) { | |
| 985 | +// /** | |
| 986 | +// * Display user profile tabs | |
| 987 | +// * | |
| 988 | +// * @param LP_User | |
| 989 | +// */ | |
| 990 | +// function learn_press_profile_tab_courses_purchased( $user, $tab = null ) { | |
| 991 | +// $args = array( | |
| 992 | +// 'user' => $user, | |
| 993 | +// 'subtab' => $tab, | |
| 994 | +// ); | |
| 995 | +// $limit = LP_Settings::instance()->get( 'profile_courses_limit', 10 ); | |
| 996 | +// $limit = apply_filters( 'learn_press_profile_tab_courses_purchased_limit', $limit ); | |
| 997 | +// $courses = $user->get( 'purchased-courses', array( 'limit' => $limit ) ); | |
| 998 | +// $num_pages = learn_press_get_num_pages( $user->_get_found_rows(), $limit ); | |
| 999 | +// $args['courses'] = $courses; | |
| 1000 | +// $args['num_pages'] = $num_pages; | |
| 1001 | +// learn_press_get_template( 'profile/tabs/courses/purchased.php', $args ); | |
| 1002 | +// } | |
| 1003 | +//} | |
| 2009 | 1004 | |
| 2010 | -if ( ! function_exists( 'learn_press_order_details_table' ) ) { | |
| 1005 | +//if ( ! function_exists( 'learn_press_profile_tab_courses_finished' ) ) { | |
| 1006 | +// /** | |
| 1007 | +// * Display user profile tabs | |
| 1008 | +// * | |
| 1009 | +// * @param LP_User | |
| 1010 | +// */ | |
| 1011 | +// function learn_press_profile_tab_courses_finished( $user, $tab = null ) { | |
| 1012 | +// $args = array( | |
| 1013 | +// 'user' => $user, | |
| 1014 | +// 'subtab' => $tab, | |
| 1015 | +// ); | |
| 1016 | +// $limit = LP_Settings::instance()->get( 'profile_courses_limit', 10 ); | |
| 1017 | +// $limit = apply_filters( 'learn_press_profile_tab_courses_finished_limit', $limit ); | |
| 1018 | +// $courses = $user->get( | |
| 1019 | +// 'enrolled-courses', | |
| 1020 | +// array( | |
| 1021 | +// 'status' => 'finished', | |
| 1022 | +// 'limit' => $limit, | |
| 1023 | +// ) | |
| 1024 | +// ); | |
| 1025 | +// $num_pages = learn_press_get_num_pages( $user->_get_found_rows(), $limit ); | |
| 1026 | +// $args['courses'] = $courses; | |
| 1027 | +// $args['num_pages'] = $num_pages; | |
| 1028 | +// learn_press_get_template( 'profile/tabs/courses/finished.php', $args ); | |
| 1029 | +// } | |
| 1030 | +//} | |
| 2011 | 1031 | |
| 2012 | - /** | |
| 2013 | - * Displays order details in a table. | |
| 2014 | - * | |
| 2015 | - * @param mixed $order_id | |
| 2016 | - * | |
| 2017 | - * @subpackage Orders | |
| 2018 | - */ | |
| 2019 | - function learn_press_order_details_table( $order_id ) { | |
| 2020 | - if ( ! $order_id ) { | |
| 2021 | - return; | |
| 2022 | - } | |
| 2023 | 1032 | |
| 2024 | - learn_press_get_template( | |
| 2025 | - 'order/order-details.php', | |
| 2026 | - array( | |
| 2027 | - 'order' => learn_press_get_order( $order_id ), | |
| 2028 | - ) | |
| 2029 | - ); | |
| 2030 | - } | |
| 2031 | -} | |
| 1033 | +//if ( ! function_exists( 'learn_press_output_user_profile_tabs' ) ) { | |
| 1034 | +// /** | |
| 1035 | +// * Display user profile tabs | |
| 1036 | +// * | |
| 1037 | +// * @param LP_User | |
| 1038 | +// */ | |
| 1039 | +// function learn_press_output_user_profile_tabs( $user, $current, $tabs ) { | |
| 1040 | +// learn_press_get_template( | |
| 1041 | +// 'profile/tabs.php', | |
| 1042 | +// array( | |
| 1043 | +// 'user' => $user, | |
| 1044 | +// 'tabs' => $tabs, | |
| 1045 | +// 'current' => $current, | |
| 1046 | +// ) | |
| 1047 | +// ); | |
| 1048 | +// } | |
| 1049 | +//} | |
| 2032 | 1050 | |
| 1051 | +//if ( ! function_exists( 'learn_press_profile_tab_courses_all' ) ) { | |
| 1052 | +// /** | |
| 1053 | +// * Display user profile tabs | |
| 1054 | +// * | |
| 1055 | +// * @param LP_User | |
| 1056 | +// */ | |
| 1057 | +// function learn_press_profile_tab_courses_all( $user, $tab = null ) { | |
| 1058 | +// $args = array( | |
| 1059 | +// 'user' => $user, | |
| 1060 | +// 'subtab' => $tab, | |
| 1061 | +// ); | |
| 1062 | +// $limit = LP_Settings::instance()->get( 'profile_courses_limit', 10 ); | |
| 1063 | +// $limit = apply_filters( 'learn_press_profile_tab_courses_all_limit', $limit ); | |
| 1064 | +// $courses = $user->get( 'courses', array( 'limit' => $limit ) ); | |
| 1065 | +// $num_pages = learn_press_get_num_pages( $user->_get_found_rows(), $limit ); | |
| 1066 | +// $args['courses'] = $courses; | |
| 1067 | +// $args['num_pages'] = $num_pages; | |
| 1068 | +// learn_press_get_template( 'profile/tabs/courses.php', $args ); | |
| 1069 | +// } | |
| 1070 | +//} | |
| 2033 | 1071 | |
| 2034 | -if ( ! function_exists( 'learn_press_profile_tab_courses_own' ) ) { | |
| 2035 | - /** | |
| 2036 | - * Display user profile tabs | |
| 2037 | - * | |
| 2038 | - * @param LP_User | |
| 2039 | - */ | |
| 2040 | - function learn_press_profile_tab_courses_own( $user, $tab = null ) { | |
| 2041 | - $args = array( | |
| 2042 | - 'user' => $user, | |
| 2043 | - 'subtab' => $tab, | |
| 2044 | - ); | |
| 2045 | - $limit = LP_Settings::instance()->get( 'profile_courses_limit', 10 ); | |
| 2046 | - $limit = apply_filters( 'learn_press_profile_tab_courses_own_limit', $limit ); | |
| 2047 | - $courses = $user->get( 'own-courses', array( 'limit' => $limit ) ); | |
| 2048 | - $num_pages = learn_press_get_num_pages( $user->_get_found_rows(), $limit ); | |
| 2049 | - $args['courses'] = $courses; | |
| 2050 | - $args['num_pages'] = $num_pages; | |
| 2051 | - learn_press_get_template( 'profile/tabs/courses/own.php', $args ); | |
| 2052 | - } | |
| 2053 | -} | |
| 1072 | +//if ( ! function_exists( 'learn_press_become_teacher_messages' ) ) { | |
| 1073 | +// function learn_press_become_teacher_messages() { | |
| 1074 | +// $messages = LP_Shortcode_Become_A_Teacher::get_messages(); | |
| 1075 | +// if ( ! $messages ) { | |
| 1076 | +// return; | |
| 1077 | +// } | |
| 1078 | +// | |
| 1079 | +// learn_press_get_template( 'global/become-teacher-form/message.php', array( 'messages' => $messages ) ); | |
| 1080 | +// } | |
| 1081 | +//} | |
| 2054 | 1082 | |
| 1083 | +//if ( ! function_exists( 'learn_press_become_teacher_heading' ) ) { | |
| 1084 | +// | |
| 1085 | +// function learn_press_become_teacher_heading() { | |
| 1086 | +// return ''; | |
| 1087 | +// } | |
| 1088 | +//} | |
| 2055 | 1089 | |
| 2056 | -if ( ! function_exists( 'learn_press_profile_tab_courses_learning' ) ) { | |
| 2057 | - /** | |
| 2058 | - * Display user profile tabs | |
| 2059 | - * | |
| 2060 | - * @param LP_User | |
| 2061 | - */ | |
| 2062 | - function learn_press_profile_tab_courses_learning( $user, $tab = null ) { | |
| 2063 | - $args = array( | |
| 2064 | - 'user' => $user, | |
| 2065 | - 'subtab' => $tab, | |
| 2066 | - ); | |
| 2067 | - $limit = LP_Settings::instance()->get( 'profile_courses_limit', 10 ); | |
| 2068 | - $limit = apply_filters( 'learn_press_profile_tab_courses_learning_limit', $limit ); | |
| 2069 | - $courses = $user->get( | |
| 2070 | - 'enrolled-courses', | |
| 2071 | - array( | |
| 2072 | - 'status' => 'enrolled', | |
| 2073 | - 'limit' => $limit, | |
| 2074 | - ) | |
| 2075 | - ); | |
| 2076 | - $num_pages = learn_press_get_num_pages( $user->_get_found_rows(), $limit ); | |
| 2077 | - $args['courses'] = $courses; | |
| 2078 | - $args['num_pages'] = $num_pages; | |
| 2079 | - learn_press_get_template( 'profile/tabs/courses/learning.php', $args ); | |
| 2080 | - } | |
| 2081 | -} | |
| 1090 | +/*if ( ! function_exists( 'learn_press_become_teacher_button' ) ) { | |
| 2082 | 1091 | |
| 2083 | -if ( ! function_exists( 'learn_press_profile_tab_courses_purchased' ) ) { | |
| 2084 | - /** | |
| 2085 | - * Display user profile tabs | |
| 2086 | - * | |
| 2087 | - * @param LP_User | |
| 2088 | - */ | |
| 2089 | - function learn_press_profile_tab_courses_purchased( $user, $tab = null ) { | |
| 2090 | - $args = array( | |
| 2091 | - 'user' => $user, | |
| 2092 | - 'subtab' => $tab, | |
| 2093 | - ); | |
| 2094 | - $limit = LP_Settings::instance()->get( 'profile_courses_limit', 10 ); | |
| 2095 | - $limit = apply_filters( 'learn_press_profile_tab_courses_purchased_limit', $limit ); | |
| 2096 | - $courses = $user->get( 'purchased-courses', array( 'limit' => $limit ) ); | |
| 2097 | - $num_pages = learn_press_get_num_pages( $user->_get_found_rows(), $limit ); | |
| 2098 | - $args['courses'] = $courses; | |
| 2099 | - $args['num_pages'] = $num_pages; | |
| 2100 | - learn_press_get_template( 'profile/tabs/courses/purchased.php', $args ); | |
| 2101 | - } | |
| 2102 | -} | |
| 2103 | - | |
| 2104 | -if ( ! function_exists( 'learn_press_profile_tab_courses_finished' ) ) { | |
| 2105 | - /** | |
| 2106 | - * Display user profile tabs | |
| 2107 | - * | |
| 2108 | - * @param LP_User | |
| 2109 | - */ | |
| 2110 | - function learn_press_profile_tab_courses_finished( $user, $tab = null ) { | |
| 2111 | - $args = array( | |
| 2112 | - 'user' => $user, | |
| 2113 | - 'subtab' => $tab, | |
| 2114 | - ); | |
| 2115 | - $limit = LP_Settings::instance()->get( 'profile_courses_limit', 10 ); | |
| 2116 | - $limit = apply_filters( 'learn_press_profile_tab_courses_finished_limit', $limit ); | |
| 2117 | - $courses = $user->get( | |
| 2118 | - 'enrolled-courses', | |
| 2119 | - array( | |
| 2120 | - 'status' => 'finished', | |
| 2121 | - 'limit' => $limit, | |
| 2122 | - ) | |
| 2123 | - ); | |
| 2124 | - $num_pages = learn_press_get_num_pages( $user->_get_found_rows(), $limit ); | |
| 2125 | - $args['courses'] = $courses; | |
| 2126 | - $args['num_pages'] = $num_pages; | |
| 2127 | - learn_press_get_template( 'profile/tabs/courses/finished.php', $args ); | |
| 2128 | - } | |
| 2129 | -} | |
| 2130 | - | |
| 2131 | - | |
| 2132 | -if ( ! function_exists( 'learn_press_output_user_profile_tabs' ) ) { | |
| 2133 | - /** | |
| 2134 | - * Display user profile tabs | |
| 2135 | - * | |
| 2136 | - * @param LP_User | |
| 2137 | - */ | |
| 2138 | - function learn_press_output_user_profile_tabs( $user, $current, $tabs ) { | |
| 2139 | - learn_press_get_template( | |
| 2140 | - 'profile/tabs.php', | |
| 2141 | - array( | |
| 2142 | - 'user' => $user, | |
| 2143 | - 'tabs' => $tabs, | |
| 2144 | - 'current' => $current, | |
| 2145 | - ) | |
| 2146 | - ); | |
| 2147 | - } | |
| 2148 | -} | |
| 2149 | - | |
| 2150 | -if ( ! function_exists( 'learn_press_profile_tab_courses_all' ) ) { | |
| 2151 | - /** | |
| 2152 | - * Display user profile tabs | |
| 2153 | - * | |
| 2154 | - * @param LP_User | |
| 2155 | - */ | |
| 2156 | - function learn_press_profile_tab_courses_all( $user, $tab = null ) { | |
| 2157 | - $args = array( | |
| 2158 | - 'user' => $user, | |
| 2159 | - 'subtab' => $tab, | |
| 2160 | - ); | |
| 2161 | - $limit = LP_Settings::instance()->get( 'profile_courses_limit', 10 ); | |
| 2162 | - $limit = apply_filters( 'learn_press_profile_tab_courses_all_limit', $limit ); | |
| 2163 | - $courses = $user->get( 'courses', array( 'limit' => $limit ) ); | |
| 2164 | - $num_pages = learn_press_get_num_pages( $user->_get_found_rows(), $limit ); | |
| 2165 | - $args['courses'] = $courses; | |
| 2166 | - $args['num_pages'] = $num_pages; | |
| 2167 | - learn_press_get_template( 'profile/tabs/courses.php', $args ); | |
| 2168 | - } | |
| 2169 | -} | |
| 2170 | - | |
| 2171 | -if ( ! function_exists( 'learn_press_become_teacher_messages' ) ) { | |
| 2172 | - function learn_press_become_teacher_messages() { | |
| 2173 | - $messages = LP_Shortcode_Become_A_Teacher::get_messages(); | |
| 2174 | - if ( ! $messages ) { | |
| 2175 | - return; | |
| 2176 | - } | |
| 2177 | - | |
| 2178 | - learn_press_get_template( 'global/become-teacher-form/message.php', array( 'messages' => $messages ) ); | |
| 2179 | - } | |
| 2180 | -} | |
| 2181 | - | |
| 2182 | -if ( ! function_exists( 'learn_press_become_teacher_heading' ) ) { | |
| 2183 | - | |
| 2184 | - function learn_press_become_teacher_heading() { | |
| 2185 | - $messages = LP_Shortcode_Become_A_Teacher::get_messages(); | |
| 2186 | - if ( $messages ) { | |
| 2187 | - return; | |
| 2188 | - } | |
| 2189 | - ?> | |
| 2190 | - <h3><?php _e( 'Fill out the form and send us your requesting.', 'learnpress' ); ?></h3> | |
| 2191 | - <?php | |
| 2192 | - } | |
| 2193 | -} | |
| 2194 | - | |
| 2195 | -if ( ! function_exists( 'learn_press_become_teacher_form_fields' ) ) { | |
| 2196 | - | |
| 2197 | - function learn_press_become_teacher_form_fields() { | |
| 2198 | - $messages = LP_Shortcode_Become_A_Teacher::get_messages(); | |
| 2199 | - if ( $messages ) { | |
| 2200 | - return; | |
| 2201 | - } | |
| 2202 | - | |
| 2203 | - include_once LP_PLUGIN_PATH . 'inc/admin/meta-box/class-lp-meta-box-helper.php'; | |
| 2204 | - | |
| 2205 | - learn_press_get_template( 'global/become-teacher-form/form-fields.php', array( 'fields' => learn_press_get_become_a_teacher_form_fields() ) ); | |
| 2206 | - } | |
| 2207 | -} | |
| 2208 | - | |
| 2209 | -if ( ! function_exists( 'learn_press_become_teacher_button' ) ) { | |
| 2210 | - | |
| 2211 | 1092 | function learn_press_become_teacher_button() { |
| 2212 | 1093 | $messages = LP_Shortcode_Become_A_Teacher::get_messages(); |
| 2213 | 1094 | if ( $messages ) { |
| 2214 | 1095 | return; |
| @@ -2215,55 +1096,11 @@ | ||
| 2215 | 1096 | } |
| 2216 | 1097 | |
| 2217 | 1098 | learn_press_get_template( 'global/become-teacher-form/button.php' ); |
| 2218 | 1099 | } |
| 2219 | -} | |
| 1100 | +}*/ | |
| 2220 | 1101 | |
| 2221 | -if ( ! function_exists( 'learn_press_back_to_class_button' ) ) { | |
| 1102 | +/*if ( ! function_exists( 'learn_press_back_to_class_button' ) ) { | |
| 2222 | 1103 | function learn_press_back_to_class_button() { |
| 2223 | - $courses_link = learn_press_get_page_link( 'courses' ); | |
| 2224 | - if ( ! $courses_link ) { | |
| 2225 | - return; | |
| 2226 | - } | |
| 2227 | - ?> | |
| 2228 | - | |
| 2229 | - <a href="<?php echo learn_press_get_page_link( 'courses' ); ?>"><?php _e( 'Back to class', 'learnpress' ); ?></a> | |
| 2230 | - <?php | |
| 1104 | + return ''; | |
| 2231 | 1105 | } |
| 2232 | -} | |
| 2233 | - | |
| 2234 | -function learn_press_get_become_a_teacher_form_fields() { | |
| 2235 | - $user = learn_press_get_current_user(); | |
| 2236 | - $fields = array( | |
| 2237 | - 'bat_name' => array( | |
| 2238 | - 'title' => __( 'Name', 'learnpress' ), | |
| 2239 | - 'type' => 'text', | |
| 2240 | - 'placeholder' => __( 'Your name', 'learnpress' ), | |
| 2241 | - 'saved' => $user->get_display_name(), | |
| 2242 | - 'id' => 'bat_name', | |
| 2243 | - 'required' => true, | |
| 2244 | - ), | |
| 2245 | - 'bat_email' => array( | |
| 2246 | - 'title' => __( 'Email', 'learnpress' ), | |
| 2247 | - 'type' => 'email', | |
| 2248 | - 'placeholder' => __( 'Your email address', 'learnpress' ), | |
| 2249 | - 'saved' => $user->get_email(), | |
| 2250 | - 'id' => 'bat_email', | |
| 2251 | - 'required' => true, | |
| 2252 | - ), | |
| 2253 | - 'bat_phone' => array( | |
| 2254 | - 'title' => __( 'Phone', 'learnpress' ), | |
| 2255 | - 'type' => 'text', | |
| 2256 | - 'placeholder' => __( 'Your phone number', 'learnpress' ), | |
| 2257 | - 'id' => 'bat_phone', | |
| 2258 | - ), | |
| 2259 | - 'bat_message' => array( | |
| 2260 | - 'title' => __( 'Message', 'learnpress' ), | |
| 2261 | - 'type' => 'textarea', | |
| 2262 | - 'placeholder' => __( 'Your message', 'learnpress' ), | |
| 2263 | - 'id' => 'bat_message', | |
| 2264 | - ), | |
| 2265 | - ); | |
| 2266 | - $fields = apply_filters( 'learn_press_become_teacher_form_fields', $fields ); | |
| 2267 | - | |
| 2268 | - return $fields; | |
| 2269 | -} | |
| 1106 | +}*/ | |