PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.4
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.4
4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 4.2.0 4.2.1 All 138 releases
learnpress / inc / lp-deprecated.php

lp-deprecated.php in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.4.4, at inc/lp-deprecated.php

1,107 lines 28.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 use LearnPress\Helpers\Template;
4
5 if ( ! function_exists( 'learn_press_course_content_lesson' ) ) {
6 /**
7 * Display course description
8 */
9 function learn_press_course_content_lesson() {
10 learn_press_get_template( 'content-lesson/summary.php' );
11 }
12 }
13
14 if ( ! function_exists( 'learn_press_course_lesson_description' ) ) {
15 /**
16 * Display course lesson description
17 */
18 function learn_press_course_lesson_description() {
19 learn_press_get_template( 'content-lesson/description.php' );
20 }
21 }
22
23 if ( ! function_exists( 'learn_press_course_quiz_description' ) ) {
24 /**
25 * Display lesson content
26 */
27 function learn_press_course_quiz_description() {
28 learn_press_get_template( 'single-course/content-quiz.php' );
29 }
30 }
31
32
33 if ( ! function_exists( 'learn_press_course_lesson_complete_button' ) ) {
34 /**
35 * Display lesson complete button
36 */
37 function learn_press_course_lesson_complete_button() {
38 learn_press_get_template( 'content-lesson/complete-button.php' );
39 }
40 }
41
42
43 if ( ! function_exists( 'learn_press_course_lesson_navigation' ) ) {
44 /**
45 * Display lesson navigation
46 */
47 function learn_press_course_lesson_navigation() {
48 learn_press_get_template( 'content-lesson/navigation.php' );
49 }
50 }
51
52
53 if ( ! function_exists( 'learn_press_single_quiz_preview_mode' ) ) {
54 /**
55 * Output the title of the quiz
56 */
57 function learn_press_single_quiz_preview_mode() {
58 learn_press_get_template( 'content-quiz/preview-mode.php' );
59 }
60 }
61
62
63 if ( ! function_exists( 'learn_press_single_quiz_left_start_wrap' ) ) {
64 function learn_press_single_quiz_left_start_wrap() {
65 learn_press_get_template( 'content-quiz/left-start-wrap.php' );
66 }
67 }
68
69
70 if ( ! function_exists( 'learn_press_single_quiz_question' ) ) {
71 /**
72 * Output the single question for quiz
73 */
74 function learn_press_single_quiz_question() {
75 learn_press_get_template( 'content-quiz/content-question.php' );
76 }
77 }
78
79
80 if ( ! function_exists( 'learn_press_single_quiz_result' ) ) {
81 /**
82 * Output the result for the quiz
83 */
84 function learn_press_single_quiz_result() {
85 learn_press_get_template( 'content-quiz/result.php' );
86 }
87 }
88
89
90 if ( ! function_exists( 'learn_press_single_quiz_questions_nav' ) ) {
91 /**
92 * Output the navigation to next and previous questions
93 */
94 function learn_press_single_quiz_questions_nav() {
95 learn_press_get_template( 'content-quiz/nav.php' );
96 }
97 }
98
99
100 if ( ! function_exists( 'learn_press_single_quiz_questions' ) ) {
101 /**
102 * Output the list of questions for quiz
103 */
104 function learn_press_single_quiz_questions() {
105 learn_press_get_template( 'content-quiz/questions.php' );
106 }
107 }
108
109
110 if ( ! function_exists( 'learn_press_single_quiz_history' ) ) {
111 /**
112 * Output the history of a quiz
113 */
114 function learn_press_single_quiz_history() {
115 learn_press_get_template( 'content-quiz/history.php' );
116 }
117 }
118
119
120 if ( ! function_exists( 'learn_press_single_quiz_left_end_wrap' ) ) {
121 function learn_press_single_quiz_left_end_wrap() {
122 learn_press_get_template( 'content-quiz/left-end-wrap.php' );
123 }
124 }
125
126
127 if ( ! function_exists( 'learn_press_single_quiz_sidebar' ) ) {
128 /**
129 * Output the sidebar for a quiz
130 */
131 function learn_press_single_quiz_sidebar() {
132 learn_press_get_template( 'content-quiz/sidebar.php' );
133 }
134 }
135
136
137 if ( ! function_exists( 'learn_press_single_quiz_information' ) ) {
138 /**
139 *
140 */
141 function learn_press_single_quiz_information() {
142 learn_press_get_template( 'content-quiz/intro.php' );
143 }
144 }
145
146
147 if ( ! function_exists( 'learn_press_single_quiz_timer' ) ) {
148 /**
149 * Output the quiz countdown timer
150 */
151 function learn_press_single_quiz_timer() {
152 learn_press_get_template( 'content-quiz/timer.php' );
153 }
154 }
155
156
157 if ( ! function_exists( 'learn_press_single_quiz_buttons' ) ) {
158 /**
159 * Output the buttons for quiz actions
160 */
161 function learn_press_single_quiz_buttons() {
162 learn_press_get_template( 'content-quiz/buttons.php' );
163 }
164 }
165
166 if ( ! function_exists( 'learn_press_single_quiz_description' ) ) {
167 /**
168 * Output the content of the quiz
169 */
170 function learn_press_single_quiz_description() {
171 learn_press_get_template( 'content-quiz/description.php' );
172 }
173 }
174
175
176 if ( ! function_exists( 'learn_press_single_quiz_information' ) ) {
177 /**
178 *
179 */
180 function learn_press_single_quiz_information() {
181 learn_press_get_template( 'content-quiz/intro.php' );
182 }
183 }
184
185
186 if ( ! function_exists( 'learn_press_single_quiz_sidebar_buttons' ) ) {
187 /**
188 *
189 */
190 function learn_press_single_quiz_sidebar_buttons() {
191 learn_press_get_template( 'content-quiz/sidebar-buttons.php' );
192 }
193 }
194
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 //}
210
211 // Show filters for students list
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() {
215 $filter = array(
216 'all' => esc_html__( 'All', 'learnpress' ),
217 'in-progress' => esc_html__( 'In Progress', 'learnpress' ),
218 'finished' => esc_html__( 'Finished', 'learnpress' ),
219 );
220
221 return apply_filters( 'learn_press_get_students_list_filter', $filter );
222 }*/
223
224
225 function learn_press_output_question_nonce( $question ) {
226 printf( '<input type="hidden" name="update-question-nonce" value="%s" />', wp_create_nonce( 'current-question-nonce-' . $question->id ) );
227 }
228
229 add_action( 'learn_press_after_question_wrap', 'learn_press_output_question_nonce' );
230
231
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 //}
250
251 /**
252 * Version 3.3.0
253 */
254
255 /**
256 * New functions since 3.0.0
257 */
258 if ( ! function_exists( 'learn_press_course_purchase_button' ) ) {
259 /**
260 * Purchase course button.
261 */
262 function learn_press_course_purchase_button() {
263 _deprecated_function( __FUNCTION__, '3.3.0' );
264 }
265 }
266
267 if ( ! function_exists( 'learn_press_course_enroll_button' ) ) {
268 /**
269 * Enroll course button.
270 */
271 function learn_press_course_enroll_button() {
272 _deprecated_function( __FUNCTION__, '3.3.0' );
273 }
274 }
275
276 if ( ! function_exists( 'learn_press_course_external_button' ) ) {
277
278 /**
279 * Retake course button
280 * @deprecated 4.2.5.3
281 */
282 function learn_press_course_external_button() {
283 _deprecated_function( __FUNCTION__, '4.2.5.3' );
284 }
285 }
286
287 if ( ! function_exists( 'learn_press_course_students' ) ) {
288 /**
289 * Display course students
290 */
291 function learn_press_course_students() {
292 learn_press_get_template( 'single-course/students.php' );
293 }
294 }
295
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 //}
304
305 if ( ! function_exists( 'learn_press_courses_loop_item_instructor' ) ) {
306 /**
307 * Output the instructor of the course within loop
308 * @using in many themes.
309 */
310 function learn_press_courses_loop_item_instructor() {
311 learn_press_get_template( 'loop/course/instructor.php' );
312 }
313 }
314
315 if ( ! function_exists( 'learn_press_course_tabs' ) ) {
316 /*
317 * Output course tabs
318 * @using in theme starkid
319 */
320 function learn_press_course_tabs() {
321 learn_press_get_template( 'single-course/tabs/tabs.php' );
322 }
323 }
324
325 /*if ( ! function_exists( 'learn_press_content_item_quiz_title' ) ) {
326 function learn_press_content_item_quiz_title() {
327 learn_press_get_template( 'content-quiz/title.php' );
328 }
329 }*/
330
331 /*if ( ! function_exists( 'learn_press_content_item_quiz_intro' ) ) {
332 function learn_press_content_item_quiz_intro() {
333 $course = learn_press_get_course();
334 $user = learn_press_get_current_user();
335 $quiz = LP_Global::course_item_quiz();
336
337 if ( $user->has_quiz_status( array( 'started', 'completed' ), $quiz->get_id(), $course->get_id() ) ) {
338 return;
339 }
340
341 if ( ! $user->has_quiz_status( 'started', $quiz->get_id(), $course->get_id() ) ) {
342 // return;
343 }
344
345 if ( $quiz->get_viewing_question() ) {
346 return;
347 }
348
349 learn_press_get_template( 'content-quiz/intro.php' );
350 }
351 }*/
352
353 /*if ( ! function_exists( 'learn_press_content_item_summary_quiz_content' ) ) {
354
355 function learn_press_content_item_summary_quiz_content() {
356 $item = LP_Global::course_item();
357
358 if ( ! $item->get_viewing_question() ) {
359 learn_press_get_template( 'content-quiz/description.php' );
360 }
361 }
362 }*/
363
364 /*if ( ! function_exists( 'learn_press_content_item_summary_question_title' ) ) {
365
366 function learn_press_content_item_summary_question_title() {
367 $quiz = LP_Global::course_item_quiz();
368
369 if ( $question = $quiz->get_viewing_question() ) {
370 learn_press_get_template( 'content-question/title.php' );
371 }
372 }
373 }*/
374
375 /*if ( ! function_exists( 'learn_press_content_item_summary_quiz_progress' ) ) {
376
377 function learn_press_content_item_summary_quiz_progress() {
378 $course = learn_press_get_course();
379 $quiz = LP_Global::course_item_quiz();
380 $user = learn_press_get_current_user();
381
382 if ( ! $user ) {
383 return;
384 }
385
386 if ( $user->has_quiz_status( array( 'viewed', '' ), $quiz->get_id(), $course->get_id() ) ) {
387 return;
388 }
389
390 if ( $question = $quiz->get_viewing_question() ) {
391 learn_press_get_template( 'content-quiz/progress.php' );
392 }
393 }
394 }*/
395
396 /*if ( ! function_exists( 'learn_press_content_item_summary_quiz_countdown' ) ) {
397
398 function learn_press_content_item_summary_quiz_countdown() {
399 $quiz = LP_Global::course_item_quiz();
400
401 if ( $question = $quiz->get_viewing_question() ) {
402 learn_press_get_template( 'content-quiz/countdown.php' );
403 }
404 }
405 }*/
406
407 /*if ( ! function_exists( 'learn_press_content_item_summary_question_content' ) ) {
408
409 function learn_press_content_item_summary_question_content() {
410 $quiz = LP_Global::course_item_quiz();
411
412 if ( $question = $quiz->get_viewing_question() ) {
413 learn_press_get_template( 'content-question/description.php' );
414 }
415 }
416 }*/
417
418 /*if ( ! function_exists( 'learn_press_content_item_summary_quiz_buttons' ) ) {
419
420 function learn_press_content_item_summary_quiz_buttons() {
421 _deprecated_function( __FUNCTION__, '3.3.0' );
422 learn_press_get_template( 'content-quiz/buttons.php' );
423 }
424 }*/
425
426 /*if ( ! function_exists( 'learn_press_profile_recover_order_form' ) ) {
427 function learn_press_profile_recover_order_form( $order ) {
428 learn_press_get_template( 'profile/tabs/orders/recover-order.php', array( 'order' => $order ) );
429 }
430 }*/
431
432
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 //}
441
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 //}
450
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 //}
459
460
461
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 //}
470
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 //}
479
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 //}
488
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 //}
497
498 if ( ! function_exists( 'learn_press_courses_loop_item_price' ) ) {
499 /**
500 * Output the price of the course within loop
501 * @using in many themes.
502 */
503 function learn_press_courses_loop_item_price() {
504 learn_press_get_template( 'loop/course/price.php' );
505 }
506 }
507
508 if ( ! function_exists( 'learn_press_begin_courses_loop' ) ) {
509 /**
510 * Output the price of the course within loop
511 * @using in many themes.
512 */
513 function learn_press_begin_courses_loop() {
514 learn_press_get_template( 'loop/course/loop-begin.php' );
515 }
516 }
517
518 if ( ! function_exists( 'learn_press_end_courses_loop' ) ) {
519 /**
520 * Output the price of the course within loop
521 * @using in many themes.
522 */
523 function learn_press_end_courses_loop() {
524 learn_press_get_template( 'loop/course/loop-end.php' );
525 }
526 }
527
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 //}
539
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 //}
548
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 //}
557
558
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 //}
567
568
569
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 //}
578
579 if ( ! function_exists( 'learn_press_course_progress' ) ) {
580 /**
581 * Display course curriculum
582 * @using ivy-school
583 */
584 function learn_press_course_progress() {
585 learn_press_get_template( 'single-course/progress.php' );
586 }
587 }
588
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 //}
597
598 if ( ! function_exists( 'learn_press_course_categories' ) ) {
599 /**
600 * Display course categories
601 * @using eduma child theme v5.5.5
602 */
603 function learn_press_course_categories() {
604 // learn_press_get_template( 'single-course/categories.php' );
605 }
606 }
607
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 //}
616
617 if ( ! function_exists( 'learn_press_course_instructor' ) ) {
618 /**
619 * Display course instructor
620 * @using in many themes.
621 */
622 function learn_press_course_instructor() {
623 learn_press_get_template( 'single-course/instructor.php' );
624 }
625 }
626
627 if ( ! function_exists( 'learn_press_course_thumbnail' ) ) {
628 /**
629 * Display Course Thumbnail
630 * @using in Eduma, Education Pack themes.
631 */
632 function learn_press_course_thumbnail() {
633 learn_press_get_template( 'single-course/thumbnail.php' );
634 }
635 }
636
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 //}
645
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 //}
654
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 //}
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 //}
672
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 //}
681
682
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 //}
698
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 //}
717
718 /* QUIZ TEMPLATES */
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 //}
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 //}
745
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 //}
756
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 //}
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 //}
778
779
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 //}
785
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 //}
791
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 //}
798
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 //}
812
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 //}
837
838 if ( ! function_exists( 'learn_press_breadcrumb' ) ) {
839 /**
840 * Output the breadcrumb of archive courses
841 * Still using
842 *
843 * @param array $args
844 * @deprecated still using addons collection, upsell, themes
845 */
846 function learn_press_breadcrumb( $args = array() ) {
847 echo Template::html_breadcrumb( $args );
848 return;
849
850 $args = wp_parse_args(
851 $args,
852 apply_filters(
853 'learn_press_breadcrumb_defaults',
854 array(
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>',
858 'before' => '',
859 'after' => '',
860 'home' => _x( 'Home', 'breadcrumb', 'learnpress' ),
861 )
862 )
863 );
864
865 $breadcrumbs = new LP_Breadcrumb();
866
867 if ( $args['home'] ) {
868 $breadcrumbs->add_crumb( $args['home'], apply_filters( 'learn_press_breadcrumb_home_url', home_url() ) );
869 }
870
871 $args['breadcrumb'] = $breadcrumbs->generate();
872
873 learn_press_get_template( 'global/breadcrumb.php', $args );
874 }
875 }
876
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 //}
893
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 //}
910
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 //}
933
934
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 //}
955
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 //}
983
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 //}
1004
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 //}
1031
1032
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 //}
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 //}
1071
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 //}
1082
1083 //if ( ! function_exists( 'learn_press_become_teacher_heading' ) ) {
1084 //
1085 // function learn_press_become_teacher_heading() {
1086 // return '';
1087 // }
1088 //}
1089
1090 /*if ( ! function_exists( 'learn_press_become_teacher_button' ) ) {
1091
1092 function learn_press_become_teacher_button() {
1093 $messages = LP_Shortcode_Become_A_Teacher::get_messages();
1094 if ( $messages ) {
1095 return;
1096 }
1097
1098 learn_press_get_template( 'global/become-teacher-form/button.php' );
1099 }
1100 }*/
1101
1102 /*if ( ! function_exists( 'learn_press_back_to_class_button' ) ) {
1103 function learn_press_back_to_class_button() {
1104 return '';
1105 }
1106 }*/
1107