PluginProbe ʕ •ᴥ•ʔ
Tutor LMS – eLearning and online course solution / 1.6.4
Tutor LMS – eLearning and online course solution v1.6.4
4.0.0 3.9.15 3.9.14 3.9.13 3.9.12 3.9.11 trunk 1.0.0 1.0.0-alpha 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.2.0 1.2.1 1.2.11 1.2.12 1.2.13 1.2.20 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.6.9 1.7.0 1.7.1 1.7.2 1.7.3 1.7.4 1.7.5 1.7.6 1.7.7 1.7.8 1.7.9 1.8.0 1.8.1 1.8.10 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 1.9.0 1.9.1 1.9.10 1.9.11 1.9.12 1.9.13 1.9.14 1.9.15 1.9.16 1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.1 2.0.10 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1.0 2.1.1 2.1.10 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.3.0 2.4.0 2.5.0 2.6.0 2.6.1 2.6.2 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 3.0.0 3.0.1 3.0.2 3.1.0 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.6.1 3.6.2 3.6.3 3.6.4 3.7.0 3.7.1 3.7.2 3.7.3 3.7.4 3.8.0 3.8.1 3.8.2 3.8.3 3.9.0 3.9.1 3.9.10 3.9.2 3.9.3 3.9.4 3.9.5 3.9.6 3.9.7 3.9.8 3.9.9
tutor / includes / tutor-template-functions.php
tutor / includes Last commit date
theme-compatibility 6 years ago tutor-general-functions.php 6 years ago tutor-template-functions.php 6 years ago tutor-template-hook.php 6 years ago
tutor-template-functions.php
1588 lines
1 <?php
2
3 if ( ! defined( 'ABSPATH' ) )
4 exit;
5
6 /**
7 * @param null $template
8 * @param bool $tutor_pro
9 *
10 * @return bool|string
11 *
12 * Load template with override file system
13 *
14 * @since v.1.0.0
15 * @updated v.1.4.2
16 * @updated v.1.4.3
17 */
18
19 if ( ! function_exists('tutor_get_template')) {
20 function tutor_get_template( $template = null, $tutor_pro = false ) {
21 if ( ! $template ) {
22 return false;
23 }
24 $template = str_replace( '.', DIRECTORY_SEPARATOR, $template );
25
26 /**
27 * Get template first from child-theme if exists
28 * If child theme not exists, then get template from parent theme
29 */
30 $template_location = trailingslashit( get_stylesheet_directory() ) . "tutor/{$template}.php";
31 if ( ! file_exists($template_location)){
32 $template_location = trailingslashit( get_template_directory() ) . "tutor/{$template}.php";
33 }
34 $file_in_theme = $template_location;
35 if ( ! file_exists( $template_location ) ) {
36 $template_location = trailingslashit( tutor()->path ) . "templates/{$template}.php";
37
38 if ( $tutor_pro && function_exists('tutor_pro')){
39 $pro_template_location = trailingslashit( tutor_pro()->path ) . "templates/{$template}.php";
40 if (file_exists($pro_template_location)){
41 $template_location = trailingslashit( tutor_pro()->path ) . "templates/{$template}.php";
42 }
43 }
44
45 if ( ! file_exists($template_location)){
46 echo '<div class="tutor-notice-warning"> '.__(sprintf('The file you are trying to load is not exists in your theme or tutor plugins location, if you are a developer and extending tutor plugin, please create a php file at location %s ', "<code>{$file_in_theme}</code>"), 'tutor').' </div>';
47 }
48 }
49
50 return apply_filters('tutor_get_template_path', $template_location, $template);
51 }
52 }
53
54 /**
55 * @param null $template
56 * @param bool $tutor_pro
57 *
58 * @return bool|mixed|void
59 *
60 * Get only template path without any warning...
61 *
62 * @since v.1.4.2
63 */
64 if ( ! function_exists('tutor_get_template_path')) {
65 function tutor_get_template_path( $template = null, $tutor_pro = false ) {
66 if ( ! $template ) {
67 return false;
68 }
69 $template = str_replace( '.', DIRECTORY_SEPARATOR, $template );
70
71 /**
72 * Get template first from child-theme if exists
73 * If child theme not exists, then get template from parent theme
74 */
75 $template_location = trailingslashit( get_stylesheet_directory() ) . "tutor/{$template}.php";
76 if ( ! file_exists( $template_location ) ) {
77 $template_location = trailingslashit( get_template_directory() ) . "tutor/{$template}.php";
78 }
79 if ( ! file_exists( $template_location ) ) {
80 $template_location = trailingslashit( tutor()->path ) . "templates/{$template}.php";
81 }
82 if ( ! file_exists($template_location) && $tutor_pro && function_exists('tutor_pro')){
83 $template_location = trailingslashit( tutor_pro()->path ) . "templates/{$template}.php";
84 }
85
86 return apply_filters( 'tutor_get_template_path', $template_location, $template );
87 }
88 }
89
90 /**
91 * @param null $template
92 *
93 * @param array $variables
94 *
95 * Load template for TUTOR
96 *
97 * @since v.1.0.0
98 *
99 * @updated v.1.1.2
100 */
101
102 if ( ! function_exists('tutor_load_template')) {
103 function tutor_load_template( $template = null, $variables = array(), $tutor_pro = false ) {
104 $variables = (array) $variables;
105 $variables = apply_filters('get_tutor_load_template_variables', $variables);
106 extract($variables);
107
108 $isLoad = apply_filters('should_tutor_load_template', true, $template, $variables);
109 if ( ! $isLoad){
110 return;
111 }
112
113 do_action('tutor_load_template_before', $template, $variables);
114 include tutor_get_template( $template, $tutor_pro );
115 do_action('tutor_load_template_after', $template, $variables);
116 }
117 }
118
119 /**
120 * @param null $template
121 * @param array $variables
122 * @param bool $tutor_pro
123 *
124 * @since v.1.4.3
125 */
126
127 if ( ! function_exists('tutor_load_template_part')) {
128 function tutor_load_template_part( $template = null, $variables = array(), $tutor_pro = false ) {
129 $variables = (array) $variables;
130 $variables = apply_filters( 'get_tutor_load_template_variables', $variables );
131 extract( $variables );
132
133 /**
134 * Get template first from child-theme if exists
135 * If child theme not exists, then get template from parent theme
136 */
137 $template_location = trailingslashit( get_stylesheet_directory() ) . "tutor/template.php";
138 if ( ! file_exists( $template_location ) ) {
139 $template_location = trailingslashit( get_template_directory() ) . "tutor/template.php";
140 }
141
142 if ( ! file_exists( $template_location ) ) {
143 $template_location = trailingslashit( tutor()->path ) . "templates/template.php";
144 if ( ! file_exists( $template_location ) && $tutor_pro && function_exists( 'tutor_pro' ) ) {
145 $template_location = trailingslashit( tutor_pro()->path ) . "templates/template.php";
146 }
147 }
148
149 include apply_filters( 'tutor_get_template_part_path', $template_location, $template );
150 }
151 }
152
153 /**
154 * @param $template_name
155 * @param array $variables
156 *
157 * @return string
158 *
159 * @since v.1.4.3
160 */
161
162 if ( ! function_exists('tutor_get_template_html')) {
163 function tutor_get_template_html( $template_name, $variables = array(), $tutor_pro = false ) {
164 ob_start();
165 tutor_load_template( $template_name, $variables, $tutor_pro );
166
167 return ob_get_clean();
168 }
169 }
170
171 if ( ! function_exists('tutor_course_loop_start')){
172 function tutor_course_loop_start($echo = true ){
173 ob_start();
174 tutor_load_template('loop.loop-start');
175 $output = apply_filters('tutor_course_loop_start', ob_get_clean());
176
177 if ( $echo ) {
178 echo $output;
179 }
180 return $output;
181 }
182 }
183
184 if ( ! function_exists('tutor_course_loop_end')) {
185 function tutor_course_loop_end( $echo = true ) {
186 ob_start();
187 tutor_load_template( 'loop.loop-end' );
188
189 $output = apply_filters( 'tutor_course_loop_end', ob_get_clean() );
190 if ( $echo ) {
191 echo $output;
192 }
193
194 return $output;
195 }
196 }
197
198 if ( ! function_exists('tutor_course_archive_pagination')) {
199 function tutor_course_archive_pagination( $echo = true ) {
200 ob_start();
201 tutor_load_template( 'loop.tutor-pagination' );
202
203 $output = apply_filters( 'tutor_course_archive_pagination', ob_get_clean() );
204 if ( $echo ) {
205 echo $output;
206 }
207
208 return $output;
209 }
210 }
211
212 function tutor_course_loop_before_content(){
213 ob_start();
214 tutor_load_template( 'loop.loop-before-content' );
215
216 $output = apply_filters( 'tutor_course_loop_before_content', ob_get_clean() );
217 echo $output;
218 }
219
220 function tutor_course_loop_after_content(){
221 ob_start();
222 tutor_load_template( 'loop.loop-after-content' );
223
224 $output = apply_filters( 'tutor_course_loop_after_content', ob_get_clean() );
225 echo $output;
226 }
227
228 if ( ! function_exists('tutor_course_loop_title')) {
229 function tutor_course_loop_title() {
230 ob_start();
231 tutor_load_template( 'loop.title' );
232 $output = apply_filters( 'tutor_course_loop_title', ob_get_clean() );
233
234 echo $output;
235 }
236 }
237
238
239 if ( ! function_exists('tutor_course_loop_header')) {
240 function tutor_course_loop_header() {
241 ob_start();
242 tutor_load_template( 'loop.header' );
243 $output = apply_filters( 'tutor_course_loop_header', ob_get_clean() );
244
245 echo $output;
246 }
247 }
248
249 if ( ! function_exists('tutor_course_loop_footer')) {
250 function tutor_course_loop_footer() {
251 ob_start();
252 tutor_load_template( 'loop.footer' );
253 $output = apply_filters( 'tutor_course_loop_footer', ob_get_clean() );
254
255 echo $output;
256 }
257 }
258
259 //tutor_course_loop_footer
260
261
262 if ( ! function_exists('tutor_course_loop_start_content_wrap')) {
263 function tutor_course_loop_start_content_wrap() {
264 ob_start();
265 tutor_load_template( 'loop.start_content_wrap' );
266 $output = apply_filters( 'tutor_course_loop_start_content_wrap', ob_get_clean() );
267
268 echo $output;
269 }
270 }
271
272 if ( ! function_exists('tutor_course_loop_end_content_wrap')) {
273 function tutor_course_loop_end_content_wrap() {
274 ob_start();
275 tutor_load_template( 'loop.end_content_wrap' );
276 $output = apply_filters( 'tutor_course_loop_end_content_wrap', ob_get_clean() );
277
278 echo $output;
279 }
280 }
281
282 if ( ! function_exists('tutor_course_loop_thumbnail')) {
283 function tutor_course_loop_thumbnail($echo = true) {
284 ob_start();
285 tutor_load_template( 'loop.thumbnail' );
286 $output = apply_filters( 'tutor_course_loop_thumbnail', ob_get_clean() );
287
288 if ($echo){
289 echo $output;
290 }else{
291 return $output;
292 }
293 }
294 }
295
296 if( ! function_exists('tutor_course_loop_wrap_classes')) {
297 function tutor_course_loop_wrap_classes( $echo = true ) {
298 $courseID = get_the_ID();
299 $classes = apply_filters( 'tutor_course_loop_wrap_classes', array(
300 'tutor-course',
301 'tutor-course-loop',
302 'tutor-course-loop-' . $courseID,
303 ) );
304
305 $class = implode( ' ', $classes );
306 if ( $echo ) {
307 echo $class;
308 }
309
310 return $class;
311 }
312 }
313
314 if( ! function_exists('tutor_course_loop_col_classes')) {
315 function tutor_course_loop_col_classes( $echo = true ) {
316 $courseCols = tutor_utils()->get_option( 'courses_col_per_row', 4 );
317 $classes = apply_filters( 'tutor_course_loop_col_classes', array(
318 'tutor-course-col-' . $courseCols,
319 ) );
320
321 $class = implode( ' ', $classes );
322 if ( $echo ) {
323 echo $class;
324 }
325
326 return $class;
327 }
328 }
329
330
331 if ( ! function_exists('tutor_container_classes')) {
332 function tutor_container_classes( $echo = true ) {
333
334 $classes = apply_filters( 'tutor_container_classes', array(
335 'tutor-wrap tutor-courses-wrap',
336 'tutor-container'
337 ) );
338
339 $class = implode( ' ', $classes );
340
341 if ( $echo ) {
342 echo $class;
343 }
344
345 return $class;
346 }
347 }
348 if ( ! function_exists('tutor_post_class')) {
349 function tutor_post_class($default = '') {
350 $classes = apply_filters( 'tutor_post_class', array(
351 'tutor-wrap',
352 $default
353 ) );
354
355 post_class( $classes );
356 }
357 }
358
359 if ( ! function_exists('tutor_course_archive_filter_bar')) {
360 function tutor_course_archive_filter_bar() {
361 ob_start();
362 tutor_load_template( 'global.course-archive-filter-bar' );
363 $output = apply_filters( 'tutor_course_archive_filter_bar', ob_get_clean() );
364
365 echo $output;
366 }
367 }
368
369 /**
370 *
371 * Get classes for widget loop single course wrap
372 *
373 * @param bool $echo
374 *
375 * @return string
376 *
377 * @since v.1.3.1
378 */
379 if( ! function_exists('tutor_widget_course_loop_classes')) {
380 function tutor_widget_course_loop_classes( $echo = true ) {
381
382 $classes = apply_filters( 'tutor_widget_course_loop_classes', array(
383 'tutor-widget-course-loop',
384 'tutor-widget-course',
385 'tutor-widget-course-'.get_the_ID(),
386 ) );
387
388 $class = implode( ' ', $classes );
389 if ( $echo ) {
390 echo $class;
391 }
392
393 return $class;
394 }
395 }
396
397 /**
398 * Get the post thumbnail
399 */
400 if ( ! function_exists('get_tutor_course_thumbnail')) {
401 function get_tutor_course_thumbnail($size = 'post-thumbnail', $url = false) {
402 $post_id = get_the_ID();
403 $post_thumbnail_id = (int) get_post_thumbnail_id( $post_id );
404
405 if ( $post_thumbnail_id ) {
406 //$size = apply_filters( 'post_thumbnail_size', $size, $post_id );
407 $size = apply_filters( 'tutor_course_thumbnail_size', $size, $post_id );
408 if ($url){
409 return wp_get_attachment_image_url($post_thumbnail_id, $size);
410 }
411
412 $html = wp_get_attachment_image( $post_thumbnail_id, $size, false );
413 } else {
414 $placeHolderUrl = tutor()->url . 'assets/images/placeholder.jpg';
415 if ($url){
416 return $placeHolderUrl;
417 }
418 $html = sprintf('<img alt="%s" src="' . $placeHolderUrl . '" />', __('Placeholder', 'tutor'));
419 }
420
421 echo $html;
422 }
423 }
424 /**
425 * Get the course/post thumbnail src
426 */
427 if ( ! function_exists('get_tutor_course_thumbnail_src')) {
428 function get_tutor_course_thumbnail_src($size = 'post-thumbnail') {
429 $post_id = get_the_ID();
430 $post_thumbnail_id = (int) get_post_thumbnail_id( $post_id );
431
432 if ( $post_thumbnail_id ) {
433 $size = apply_filters( 'tutor_course_thumbnail_size', $size, $post_id );
434 $src = wp_get_attachment_image_url( $post_thumbnail_id, $size, false );
435 } else {
436 $src = tutor()->url . 'assets/images/placeholder.jpg';
437 }
438
439 return $src;
440 }
441 }
442
443 if ( ! function_exists('tutor_course_loop_meta')) {
444 function tutor_course_loop_meta() {
445 ob_start();
446 tutor_load_template( 'loop.meta' );
447 $output = apply_filters( 'tutor_course_loop_meta', ob_get_clean() );
448
449 echo $output;
450 }
451 }
452
453 /**
454 * Get course author name in loop
455 *
456 * @since: v.1.0.0
457 */
458
459 if ( ! function_exists('tutor_course_loop_author')) {
460 function tutor_course_loop_author() {
461 ob_start();
462 tutor_load_template( 'loop.course-author' );
463 $output = apply_filters( 'tutor_course_loop_author', ob_get_clean() );
464
465 echo $output;
466 }
467 }
468
469 /**
470 * Get formatted price with cart form
471 */
472
473 if ( ! function_exists('tutor_course_loop_price')) {
474 function tutor_course_loop_price() {
475 ob_start();
476
477 $tutor_course_sell_by = apply_filters('tutor_course_sell_by', null);
478 if ($tutor_course_sell_by){
479 tutor_load_template( 'loop.course-price-'.$tutor_course_sell_by );
480 }else{
481 tutor_load_template( 'loop.course-price' );
482 }
483 $output = apply_filters( 'tutor_course_loop_price', ob_get_clean() );
484
485 echo $output;
486 }
487 }
488
489 /**
490 * Get Course rating
491 *
492 * @since v.1.0.0
493 * @updated v.1.4.5
494 */
495
496 if ( ! function_exists('tutor_course_loop_rating')) {
497 function tutor_course_loop_rating() {
498
499 $disable = get_tutor_option('disable_course_review');
500 if ($disable){
501 return;
502 }
503
504 ob_start();
505 tutor_load_template( 'loop.rating' );
506 $output = apply_filters( 'tutor_course_loop_rating', ob_get_clean() );
507
508 echo $output;
509 }
510 }
511
512 /**
513 * @param bool $echo
514 *
515 * @return mixed|void
516 *
517 * Get add to cart form
518 */
519
520 if ( ! function_exists('tutor_course_loop_add_to_cart')) {
521 function tutor_course_loop_add_to_cart($echo = true) {
522 ob_start();
523 $tutor_course_sell_by = apply_filters('tutor_course_sell_by', null);
524
525 if ($tutor_course_sell_by){
526 tutor_load_template( 'loop.add-to-cart-'.$tutor_course_sell_by );
527 }
528
529 $output = apply_filters( 'tutor_course_loop_add_to_cart_link', ob_get_clean() );
530
531 if ($echo){
532 echo $output;
533 }
534 return $output;
535 }
536 }
537
538 if ( ! function_exists('tutor_course_price')) {
539 function tutor_course_price() {
540 ob_start();
541 tutor_load_template( 'single.course.wc-price-html' );
542 $output = apply_filters( 'tutor_course_price', ob_get_clean() );
543
544 echo $output;
545 }
546 }
547
548 /**
549 * @param int $post_id
550 *
551 * echo the excerpt of TUTOR post type
552 *
553 * @since: v.1.0.0
554 */
555 if ( ! function_exists('tutor_the_excerpt')) {
556 function tutor_the_excerpt( $post_id = 0 ) {
557 if ( ! $post_id ) {
558 $post_id = get_the_ID();
559 }
560 echo tutor_get_the_excerpt( $post_id );
561 }
562 }
563 /**
564 * @param int $post_id
565 *
566 * @return mixed
567 *
568 * Return excerpt of TUTOR post type
569 *
570 * @since: v.1.0.0
571 */
572 if ( ! function_exists('tutor_get_the_excerpt')) {
573 function tutor_get_the_excerpt( $post_id = 0 ) {
574 if ( ! $post_id ) {
575 $post_id = get_the_ID();
576 }
577
578 $get_post = get_post($post_id);
579 return apply_filters( 'tutor_get_the_excerpt', $get_post->post_excerpt );
580 }
581 }
582
583 /**
584 * @return mixed
585 *
586 * return course author
587 *
588 * @since: v.1.0.0
589 */
590
591 if ( ! function_exists('get_tutor_course_author')) {
592 function get_tutor_course_author() {
593 global $post;
594 return apply_filters( 'get_tutor_course_author', get_the_author_meta( 'display_name', $post->post_author ) );
595 }
596 }
597
598 function get_tutor_course_author_id(){
599 global $post;
600 return (int) $post->post_author;
601 }
602
603 /**
604 * @param int $course_id
605 *
606 * @return mixed
607 * Course benefits return array
608 *
609 * @since: v.1.0.0
610 */
611
612 if ( ! function_exists('tutor_course_benefits')) {
613 function tutor_course_benefits( $course_id = 0 ) {
614 if ( ! $course_id ) {
615 $course_id = get_the_ID();
616 }
617 $benefits = get_post_meta( $course_id, '_tutor_course_benefits', true );
618
619 $benefits_array = array();
620 if ($benefits){
621 $benefits_array = explode("\n", $benefits);
622 }
623
624 $array = array_filter(array_map('trim', $benefits_array));
625
626 return apply_filters( 'tutor_course/single/benefits', $array, $course_id );
627 }
628 }
629
630 /**
631 * @param bool $echo
632 *
633 * @return mixed
634 *
635 * Course single page benefits
636 *
637 * @since: v.1.0.0
638 */
639
640 if ( ! function_exists('tutor_course_benefits_html')) {
641 function tutor_course_benefits_html($echo = true) {
642 ob_start();
643 tutor_load_template( 'single.course.course-benefits' );
644 $output = apply_filters( 'tutor_course/single/benefits_html', ob_get_clean() );
645
646 if ($echo){
647 echo $output;
648 }
649 return $output;
650 }
651 }
652
653 /**
654 * @param bool $echo
655 *
656 * @return mixed|void
657 *
658 * Return Topics HTML
659 *
660 * @since: v.1.0.0
661 */
662 if ( ! function_exists('tutor_course_topics')) {
663 function tutor_course_topics( $echo = true ) {
664 ob_start();
665 tutor_load_template( 'single.course.course-topics' );
666 $output = apply_filters( 'tutor_course/single/topics', ob_get_clean() );
667 wp_reset_postdata();
668
669 if ( $echo ) {
670 echo $output;
671 }
672
673 return $output;
674 }
675 }
676
677 /**
678 * @param int $course_id
679 *
680 * @return mixed|void
681 *
682 * return course requirements in array
683 *
684 * @since: v.1.0.0
685 */
686 if ( ! function_exists('tutor_course_requirements')) {
687 function tutor_course_requirements( $course_id = 0 ) {
688 if ( ! $course_id ) {
689 $course_id = get_the_ID();
690 }
691 $requirements = get_post_meta( $course_id, '_tutor_course_requirements', true );
692
693 $requirements_array = array();
694 if ($requirements){
695 $requirements_array = explode("\n", $requirements);
696 }
697
698 $array = array_filter(array_map('trim', $requirements_array));
699 return apply_filters( 'tutor_course/single/requirements', $array, $course_id );
700 }
701 }
702
703 /**
704 * @param bool $echo
705 *
706 * @return mixed|void
707 *
708 * Return course requirements in course single page
709 *
710 * @since: v.1.0.0
711 */
712 if ( ! function_exists('tutor_course_requirements_html')) {
713 function tutor_course_requirements_html($echo = true) {
714 ob_start();
715 tutor_load_template( 'single.course.course-requirements' );
716 $output = apply_filters( 'tutor_course/single/requirements_html', ob_get_clean() );
717
718 if ($echo){
719 echo $output;
720 }
721 return $output;
722 }
723 }
724
725
726 /**
727 * @param int $course_id
728 *
729 * @return mixed|void
730 *
731 * Return target audience in course single page
732 *
733 * @since: v.1.0.0
734 */
735 if ( ! function_exists('tutor_course_target_audience')) {
736 function tutor_course_target_audience( $course_id = 0 ) {
737 if ( ! $course_id ) {
738 $course_id = get_the_ID();
739 }
740 $target_audience = get_post_meta( $course_id, '_tutor_course_target_audience', true );
741
742 $target_audience_array = array();
743 if ($target_audience){
744 $target_audience_array = explode("\n", $target_audience);
745 }
746
747 $array = array_filter(array_map('trim', $target_audience_array));
748 return apply_filters( 'tutor_course/single/target_audience', $array, $course_id );
749 }
750 }
751
752 /**
753 * @param bool $echo
754 *
755 * @return mixed|void
756 *
757 * Return target audience in course single page
758 *
759 * @since: v.1.0.0
760 */
761 if ( ! function_exists('tutor_course_target_audience_html')) {
762 function tutor_course_target_audience_html($echo = true) {
763 ob_start();
764 tutor_load_template( 'single.course.course-target-audience' );
765 $output = apply_filters( 'tutor_course/single/audience_html', ob_get_clean() );
766
767 if ($echo){
768 echo $output;
769 }
770 return $output;
771 }
772 }
773
774
775 if ( ! function_exists('tutor_course_material_includes')) {
776 function tutor_course_material_includes( $course_id = 0 ) {
777 if ( ! $course_id ) {
778 $course_id = get_the_ID();
779 }
780 $target_audience = get_post_meta( $course_id, '_tutor_course_material_includes', true );
781
782 $target_audience_array = array();
783 if ($target_audience){
784 $target_audience_array = explode("\n", $target_audience);
785 }
786
787 $array = array_filter(array_map('trim', $target_audience_array));
788 return apply_filters( 'tutor_course/single/material_includes', $array, $course_id );
789 }
790 }
791
792 if ( ! function_exists('tutor_course_material_includes_html')) {
793 function tutor_course_material_includes_html($echo = true) {
794 ob_start();
795 tutor_load_template( 'single.course.material-includes' );
796 $output = apply_filters( 'tutor_course/single/material_includes', ob_get_clean() );
797
798 if ($echo){
799 echo $output;
800 }
801 return $output;
802 }
803 }
804
805 //tutor_course_material_includes_html
806
807
808 if ( ! function_exists('tutor_course_instructors_html')) {
809 function tutor_course_instructors_html($echo = true) {
810 $display_course_instructors = tutor_utils()->get_option('display_course_instructors');
811 if ( ! $display_course_instructors){
812 return null;
813 }
814
815 ob_start();
816 tutor_load_template( 'single.course.instructors' );
817 $output = apply_filters( 'tutor_course/single/instructors_html', ob_get_clean() );
818
819 if ($echo){
820 echo $output;
821 }
822 return $output;
823 }
824 }
825
826 if ( ! function_exists('tutor_course_target_reviews_html')) {
827 function tutor_course_target_reviews_html($echo = true) {
828 ob_start();
829 tutor_load_template( 'single.course.reviews' );
830 $output = apply_filters( 'tutor_course/single/reviews_html', ob_get_clean() );
831
832 if ($echo){
833 echo $output;
834 }
835 return $output;
836 }
837 }
838
839 if ( ! function_exists('tutor_course_target_review_form_html')) {
840 function tutor_course_target_review_form_html($echo = true) {
841 $isDisableReview = (bool) tutils()->get_option('disable_course_review');
842 if ($isDisableReview){
843 $output = apply_filters('tutor_review_disabled_text', '');
844
845 if ($echo){
846 echo $output;
847 }
848 return $output;
849 }
850
851 ob_start();
852 tutor_load_template( 'single.course.review-form' );
853 $output = apply_filters( 'tutor_course/single/reviews_form', ob_get_clean() );
854
855 if ($echo){
856 echo $output;
857 }
858 return $output;
859 }
860 }
861
862 /**
863 * @param bool $echo
864 *
865 * @return mixed
866 *
867 * Course single page main content / description
868 *
869 * @since: v.1.0.0
870 */
871 if ( ! function_exists('tutor_course_content')) {
872 function tutor_course_content( $echo = true ) {
873 ob_start();
874 tutor_load_template( 'single.course.course-content' );
875 $output = apply_filters( 'tutor_course/single/content', ob_get_clean() );
876
877 if ( $echo ) {
878 echo $output;
879 }
880
881 return $output;
882 }
883 }
884
885 /**
886 * Course single page lead info
887 *
888 * @since: v.1.0.0
889 */
890 if ( ! function_exists('tutor_course_lead_info')) {
891 function tutor_course_lead_info( $echo = true ) {
892 ob_start();
893
894 $course_id = get_the_ID();
895 $course_post_type = tutor()->course_post_type;
896 $queryCourse = new WP_Query(array('p' => $course_id, 'post_type' => $course_post_type));
897
898 if ($queryCourse->have_posts()){
899 while ($queryCourse->have_posts()){
900 $queryCourse->the_post();
901 tutor_load_template( 'single.course.lead-info' );
902 }
903 wp_reset_postdata();
904 }
905
906 $output = apply_filters( 'tutor_course/single/lead_info', ob_get_clean() );
907
908 if ( $echo ) {
909 echo $output;
910 }
911 return $output;
912 }
913 }
914
915 /**
916 * @param bool $echo
917 *
918 * @return mixed|void
919 */
920
921 if ( ! function_exists('tutor_course_enrolled_lead_info')) {
922 function tutor_course_enrolled_lead_info( $echo = true ) {
923 ob_start();
924
925 $course_id = get_the_ID();
926 $course_post_type = tutor()->course_post_type;
927 $queryCourse = new WP_Query( array( 'p' => $course_id, 'post_type' => $course_post_type ) );
928
929 if ( $queryCourse->have_posts() ) {
930 while ( $queryCourse->have_posts() ) {
931 $queryCourse->the_post();
932 tutor_load_template( 'single.course.enrolled.lead-info' );
933 }
934 wp_reset_postdata();
935 }
936
937 $output = apply_filters( 'tutor_course/single/enrolled/lead_info', ob_get_clean() );
938
939 if ( $echo ) {
940 echo $output;
941 }
942
943 return $output;
944 }
945 }
946
947 if ( ! function_exists('tutor_lesson_lead_info')) {
948 function tutor_lesson_lead_info( $lesson_id = 0, $echo = true ) {
949 if ( ! $lesson_id ) {
950 $lesson_id = get_the_ID();
951 }
952
953 ob_start();
954 $course_id = tutor_utils()->get_course_id_by_lesson( $lesson_id );
955 $course_post_type = tutor()->course_post_type;
956 $queryCourse = new WP_Query( array( 'p' => $course_id, 'post_type' => $course_post_type ) );
957
958 if ( $queryCourse->have_posts() ) {
959 while ( $queryCourse->have_posts() ) {
960 $queryCourse->the_post();
961 tutor_load_template( 'single.course.enrolled.lead-info' );
962 }
963 wp_reset_postdata();
964 }
965 $output = apply_filters( 'tutor_course/single/enrolled/lead_info', ob_get_clean() );
966
967 if ( $echo ) {
968 echo $output;
969 }
970
971 return $output;
972
973 }
974 }
975 /**
976 * @param bool $echo
977 *
978 * @return mixed
979 *
980 * Return enroll box in single course
981 *
982 * @since: v.1.0.0
983 */
984
985 if ( ! function_exists('tutor_course_enroll_box')) {
986 function tutor_course_enroll_box( $echo = true ) {
987 $isLoggedIn = is_user_logged_in();
988 $enrolled = tutor_utils()->is_enrolled();
989
990 ob_start();
991
992 if ( $enrolled ) {
993 tutor_load_template( 'single.course.course-enrolled-box' );
994 $output = apply_filters( 'tutor_course/single/enrolled', ob_get_clean() );
995 } else {
996 tutor_load_template( 'single.course.course-enroll-box' );
997 $output = apply_filters( 'tutor_course/single/enroll', ob_get_clean() );
998 }
999
1000 if ( $echo ) {
1001 echo $output;
1002 }
1003
1004 return $output;
1005 }
1006 }
1007
1008 /**
1009 * @param bool $echo
1010 *
1011 * @return string
1012 *
1013 * Get Only add to cart form
1014 */
1015
1016 function tutor_single_course_add_to_cart($echo = true){
1017 ob_start();
1018
1019 $isLoggedIn = is_user_logged_in();
1020 $output = '';
1021
1022 $total_enrolled = tutor_utils()->count_enrolled_users_by_course();
1023 $maximum_students = (int) tutor_utils()->get_course_settings(null, 'maximum_students');
1024
1025 if ($maximum_students && $maximum_students <= $total_enrolled) {
1026 $template = 'closed-enrollment';
1027 } else {
1028 $template = 'add-to-cart';
1029 }
1030
1031 tutor_load_template( 'single.course.'.$template );
1032 $output .= apply_filters( 'tutor_course/single/'.$template, ob_get_clean() );
1033
1034 if (!$isLoggedIn) {
1035 ob_start();
1036 tutor_load_template( 'single.course.login' );
1037 $login_form = apply_filters( 'tutor_course/global/login', ob_get_clean() );
1038
1039 $output .= "<div class='tutor-cart-box-login-form' style='display: none;'><span class='login-overlay-close'></span><div class='tutor-cart-box-login-form-inner'><button class='tutor-popup-form-close tutor-icon-line-cross'></button>{$login_form}</div></div>";
1040 }
1041
1042 if ( $echo ) {
1043 echo $output;
1044 }
1045
1046 return $output;
1047 }
1048
1049 if ( ! function_exists('tutor_course_enrolled_nav')) {
1050 function tutor_course_enrolled_nav($echo = true) {
1051 $course_post_type = tutor()->course_post_type;
1052 $lesson_post_type = tutor()->lesson_post_type;
1053
1054 ob_start();
1055 global $post;
1056
1057 if ( ! empty($post->post_type) && $post->post_type === $course_post_type){
1058 tutor_load_template( 'single.course.enrolled.nav' );
1059 }elseif(! empty($post->post_type) && $post->post_type === $lesson_post_type){
1060 $lesson_id = get_the_ID();
1061 $course_id = tutor_utils()->get_course_id_by_lesson($lesson_id);
1062
1063 $course_post_type = tutor()->course_post_type;
1064 $queryCourse = new WP_Query(array('p' => $course_id, 'post_type' => $course_post_type));
1065
1066 if ($queryCourse->have_posts()){
1067 while ($queryCourse->have_posts()){
1068 $queryCourse->the_post();
1069 tutor_load_template( 'single.course.enrolled.nav' );
1070 }
1071 wp_reset_postdata();
1072 }
1073 }
1074 $output = apply_filters( 'tutor_course/single/enrolled/nav', ob_get_clean() );
1075
1076 if ( $echo ) {
1077 echo $output;
1078 }
1079 return $output;
1080 }
1081 }
1082
1083 if ( ! function_exists('tutor_course_video')){
1084 function tutor_course_video($echo = true){
1085 ob_start();
1086 tutor_load_template( 'single.video.video' );
1087 $output = apply_filters( 'tutor_course/single/video', ob_get_clean() );
1088
1089 if ( $echo ) {
1090 echo $output;
1091 }
1092 return $output;
1093 }
1094 }
1095
1096 if ( ! function_exists('tutor_lesson_video')){
1097 function tutor_lesson_video($echo = true){
1098 ob_start();
1099 tutor_load_template( 'single.video.video' );
1100 $output = apply_filters( 'tutor_lesson/single/video', ob_get_clean() );
1101
1102 if ( $echo ) {
1103 echo $output;
1104 }
1105 return $output;
1106 }
1107 }
1108
1109 /**
1110 *
1111 * Get all lessons attachments
1112 *
1113 * @param bool $echo
1114 *
1115 * @return mixed
1116 *
1117 * @since v.1.0.0
1118 */
1119 if ( ! function_exists('get_tutor_posts_attachments')){
1120 function get_tutor_posts_attachments($echo = true){
1121 ob_start();
1122 tutor_load_template( 'global.attachments' );
1123 $output = apply_filters( 'tutor_lesson/single/attachments', ob_get_clean() );
1124
1125 if ( $echo ) {
1126 echo $output;
1127 }
1128 return $output;
1129 }
1130 }
1131
1132 /**
1133 * @param bool $echo
1134 *
1135 * @return mixed
1136 *
1137 * Get the lessons with topics
1138 *
1139 * @since v.1.0.0
1140 */
1141 if ( ! function_exists('tutor_lessons_sidebar')) {
1142 function tutor_lessons_sidebar( $echo = true ) {
1143 ob_start();
1144 tutor_load_template( 'single.lesson.lesson_sidebar' );
1145 $output = apply_filters( 'tutor_lesson/single/lesson_sidebar', ob_get_clean() );
1146
1147 if ( $echo ) {
1148 echo $output;
1149 }
1150
1151 return $output;
1152 }
1153 }
1154
1155 /**
1156 * @param bool $echo
1157 *
1158 * @return mixed
1159 *
1160 * Render Lesson Main Content
1161 * @since v.1.0.0
1162 */
1163 if ( ! function_exists('tutor_lesson_content')) {
1164 function tutor_lesson_content( $echo = true ) {
1165 ob_start();
1166 tutor_load_template( 'single.lesson.content' );
1167 $output = apply_filters( 'tutor_lesson/single/content', ob_get_clean() );
1168
1169 if ( $echo ) {
1170 echo $output;
1171 }
1172
1173 return $output;
1174 }
1175 }
1176
1177 if ( ! function_exists('tutor_lesson_mark_complete_html')) {
1178 function tutor_lesson_mark_complete_html( $echo = true ) {
1179 ob_start();
1180 tutor_load_template( 'single.lesson.complete_form' );
1181 $output = apply_filters( 'tutor_lesson/single/complete_form', ob_get_clean() );
1182
1183 if ( $echo ) {
1184 echo $output;
1185 }
1186
1187 return $output;
1188 }
1189 }
1190
1191 if ( ! function_exists('tutor_course_mark_complete_html')) {
1192 function tutor_course_mark_complete_html( $echo = true ) {
1193 ob_start();
1194 tutor_load_template( 'single.course.complete_form' );
1195 $output = apply_filters( 'tutor_course/single/complete_form', ob_get_clean() );
1196
1197 if ( $echo ) {
1198 echo $output;
1199 }
1200
1201 return $output;
1202 }
1203 }
1204
1205
1206 /**
1207 * @param bool $echo
1208 *
1209 * @return mixed
1210 *
1211 * @show progress bar about course complete
1212 *
1213 * @since v.1.0.0
1214 */
1215
1216 if ( ! function_exists('tutor_course_completing_progress_bar')) {
1217 function tutor_course_completing_progress_bar( $echo = true ) {
1218 ob_start();
1219 tutor_load_template( 'single.course.enrolled.completing-progress' );
1220 $output = apply_filters( 'tutor_course/single/completing-progress-bar', ob_get_clean() );
1221
1222 if ( $echo ) {
1223 echo $output;
1224 }
1225
1226 return $output;
1227 }
1228 }
1229
1230 function tutor_course_question_and_answer($echo = true){
1231 ob_start();
1232 tutor_load_template( 'single.course.enrolled.question_and_answer' );
1233 $output = apply_filters( 'tutor_course/single/question_and_answer', ob_get_clean() );
1234
1235 if ( $echo ) {
1236 echo $output;
1237 }
1238
1239 return $output;
1240 }
1241
1242
1243 function tutor_course_announcements($echo = true){
1244 ob_start();
1245 tutor_load_template( 'single.course.enrolled.announcements' );
1246 $output = apply_filters( 'tutor_course/single/announcements', ob_get_clean() );
1247
1248 if ( $echo ) {
1249 echo $output;
1250 }
1251
1252 return $output;
1253 }
1254
1255 function tutor_single_quiz_top($echo = true){
1256 ob_start();
1257 tutor_load_template( 'single.quiz.top' );
1258 $output = apply_filters( 'tutor_single_quiz/top', ob_get_clean() );
1259
1260 if ( $echo ) {
1261 echo $output;
1262 }
1263 return $output;
1264 }
1265
1266 function tutor_single_quiz_body($echo = true){
1267 ob_start();
1268 tutor_load_template( 'single.quiz.body' );
1269 $output = apply_filters( 'tutor_single_quiz/body', ob_get_clean() );
1270
1271 if ( $echo ) {
1272 echo $output;
1273 }
1274 return $output;
1275 }
1276
1277 /**
1278 * @param bool $echo
1279 *
1280 * @return mixed|void
1281 *
1282 * Get the quiz description
1283 */
1284 function tutor_single_quiz_content($echo = true){
1285 ob_start();
1286 tutor_load_template( 'single.quiz.content' );
1287 $output = apply_filters( 'tutor_single_quiz/content', ob_get_clean() );
1288
1289 if ( $echo ) {
1290 echo $output;
1291 }
1292 return $output;
1293 }
1294
1295
1296 function tutor_single_quiz_no_course_belongs($echo = true){
1297 ob_start();
1298 tutor_load_template( 'single.quiz.no_course_belongs' );
1299 $output = apply_filters( 'tutor_single_quiz/no_course_belongs', ob_get_clean() );
1300
1301 if ( $echo ) {
1302 echo $output;
1303 }
1304 return $output;
1305 }
1306
1307 function single_quiz_contents($echo = true){
1308
1309 ob_start();
1310 tutor_load_template( 'single.quiz.single_quiz_contents' );
1311 $output = apply_filters( 'tutor_single_quiz/single_quiz_contents', ob_get_clean() );
1312
1313 if ( $echo ) {
1314 echo $output;
1315 }
1316 return $output;
1317 }
1318
1319 function get_tutor_course_level($course_id = 0){
1320 if ( ! $course_id){
1321 $course_id = get_the_ID();
1322 }
1323 if ( ! $course_id){
1324 return '';
1325 }
1326
1327 $course_level = get_post_meta($course_id, '_tutor_course_level', true);
1328
1329 if ($course_level){
1330 return tutor_utils()->course_levels($course_level);
1331 }
1332 return false;
1333 }
1334
1335 if ( ! function_exists('get_tutor_course_duration_context')) {
1336 function get_tutor_course_duration_context( $course_id = 0 ) {
1337 if ( ! $course_id ) {
1338 $course_id = get_the_ID();
1339 }
1340 if ( ! $course_id ) {
1341 return '';
1342 }
1343 $duration = get_post_meta( $course_id, '_course_duration', true );
1344 $durationHours = tutor_utils()->avalue_dot( 'hours', $duration );
1345 $durationMinutes = tutor_utils()->avalue_dot( 'minutes', $duration );
1346 $durationSeconds = tutor_utils()->avalue_dot( 'seconds', $duration );
1347
1348 if ( $duration ) {
1349 $output = '';
1350 if ( $durationHours > 0 ) {
1351 $output .= $durationHours . "h ";
1352 }
1353
1354 if ( $durationMinutes > 0 ) {
1355 $output .= $durationMinutes . "m ";
1356 }
1357
1358 if ( $durationSeconds > 0 ) {
1359 $output .= $durationSeconds ."s ";
1360 }
1361
1362 return $output;
1363 }
1364
1365 return false;
1366 }
1367 }
1368 if ( ! function_exists('get_tutor_course_categories')){
1369 function get_tutor_course_categories($course_id = 0){
1370 if ( ! $course_id ) {
1371 $course_id = get_the_ID();
1372 }
1373 $terms = get_the_terms( $course_id, 'course-category' );
1374
1375 return $terms;
1376 }
1377 }
1378
1379 /**
1380 * @param int $course_id
1381 *
1382 * @return array|false|WP_Error
1383 *
1384 * Get course tags
1385 */
1386
1387 if ( ! function_exists('get_tutor_course_tags')){
1388 function get_tutor_course_tags($course_id = 0){
1389 if ( ! $course_id ) {
1390 $course_id = get_the_ID();
1391 }
1392 $terms = get_the_terms( $course_id, 'course-tag' );
1393
1394 return $terms;
1395 }
1396 }
1397
1398 /**
1399 * @param bool $echo
1400 *
1401 * @return mixed|void
1402 *
1403 * Template for course tags html
1404 */
1405
1406 if ( ! function_exists('tutor_course_tags_html')) {
1407 function tutor_course_tags_html( $echo = true ) {
1408 ob_start();
1409 tutor_load_template( 'single.course.tags' );
1410 $output = apply_filters( 'tutor_course/single/tags_html', ob_get_clean() );
1411
1412 if ( $echo ) {
1413 echo $output;
1414 }
1415
1416 return $output;
1417 }
1418 }
1419
1420 /**
1421 * @param bool $echo
1422 *
1423 * @return mixed
1424 *
1425 * Get Q&A in lesson sidebar
1426 */
1427
1428 if ( ! function_exists('tutor_lesson_sidebar_question_and_answer')) {
1429 function tutor_lesson_sidebar_question_and_answer( $echo = true ) {
1430 ob_start();
1431 tutor_load_template( 'single.lesson.sidebar_question_and_answer' );
1432 $output = apply_filters( 'tutor_lesson/single/sidebar_question_and_answer', ob_get_clean() );
1433
1434 if ( $echo ) {
1435 echo $output;
1436 }
1437
1438 return $output;
1439 }
1440 }
1441
1442 /**
1443 * @param bool $echo
1444 *
1445 * @return mixed|void
1446 *
1447 * Get Social Share button to share on social media
1448 */
1449
1450 if ( ! function_exists('tutor_social_share')) {
1451 function tutor_social_share( $echo = true ) {
1452 ob_start();
1453 tutor_load_template( 'single.course.social_share' );
1454 $output = apply_filters( 'tutor_course/single/social_share', ob_get_clean() );
1455
1456 if ( $echo ) {
1457 echo $output;
1458 }
1459
1460 return $output;
1461 }
1462 }
1463
1464 /**
1465 * @param bool $echo
1466 *
1467 * @return mixed
1468 *
1469 * Get Assignment content
1470 *
1471 * @since v.1.3.3
1472 */
1473
1474 if ( ! function_exists('tutor_assignment_content')) {
1475 function tutor_assignment_content( $echo = true ) {
1476 ob_start();
1477 tutor_load_template( 'single.assignment.content' );
1478 $output = apply_filters( 'tutor_assignment/single/content', ob_get_clean() );
1479
1480 if ( $echo ) {
1481 echo $output;
1482 }
1483
1484 return $output;
1485 }
1486 }
1487
1488 /**
1489 * @param string $msg
1490 * @param string $title
1491 * @param string $type
1492 *
1493 * @return string
1494 *
1495 * @since v.1.4.0
1496 */
1497
1498 if ( ! function_exists('get_tnotice')) {
1499 function get_tnotice( $msg = '', $title = 'Success', $type = 'success' ) {
1500
1501 $output = '<div class="tnotice tnotice--' . $type . '">
1502 <div class="tnotice__icon">&iexcl;</div>
1503 <div class="tnotice__content">';
1504
1505 if ($title){
1506 $output .='<p class="tnotice__type">' . $title . '</p>';
1507 }
1508 $output .='<p class="tnotice__message">' . $msg . '</p>
1509 </div>
1510 </div>';
1511
1512 return $output;
1513 }
1514 }
1515
1516 /**
1517 * @param int $course_content_id
1518 * @param bool $echo
1519 *
1520 * @return mixed|void
1521 *
1522 * Next Previous Pagination
1523 *
1524 * @since v.1.4.7
1525 */
1526
1527 function tutor_next_previous_pagination($course_content_id = 0, $echo = true){
1528 $content_id = tutils()->get_post_id($course_content_id);
1529 $contents = tutils()->get_course_prev_next_contents_by_id($content_id);
1530 $previous_id = $contents->previous_id;
1531 $next_id = $contents->next_id;
1532
1533 ob_start();
1534 do_action('tutor_lesson_next_previous_pagination_before');
1535 tutor_load_template( 'single.next-previous-pagination', compact('previous_id', 'next_id') );
1536 do_action('tutor_lesson_next_previous_pagination_after');
1537 $output = apply_filters( 'tutor/single/next_previous_pagination', ob_get_clean() );
1538
1539 if ( $echo ) {
1540 echo $output;
1541 }
1542
1543 return $output;
1544 }
1545
1546
1547 /**
1548 * Required login form in archive page
1549 * @param bool $echo
1550 * @since v 1.5.5
1551 *
1552 * @todo, it will be remove from 2.0.0
1553 */
1554 function tutor_archive_course_add_to_cart($echo = true){
1555 _deprecated_function( __FUNCTION__, '1.5.8' );
1556
1557 $output = '';
1558 if ( $echo ) {
1559 echo $output;
1560 }
1561 return $output;
1562 }
1563
1564 /**
1565 * @param bool $echo
1566 * @return string
1567 *
1568 * Display login form in popup where necessary
1569 *
1570 * @since v.1.5.8
1571 */
1572
1573 if ( ! function_exists('tutor_login_form_popup')) {
1574 function tutor_login_form_popup($echo = true){
1575 $output = '';
1576 ob_start();
1577 tutor_load_template('single.course.login');
1578 $login_form = apply_filters('tutor_course/global/login', ob_get_clean());
1579 $output .= "<div class='tutor-cart-box-login-form' style='display: none;'><span class='login-overlay-close'></span><div class='tutor-cart-box-login-form-inner'><button class='tutor-popup-form-close tutor-icon-line-cross'></button>{$login_form}</div></div>";
1580
1581 $output = apply_filters('tutor_login_form_popup_html', $output);
1582
1583 if ($echo) {
1584 echo $output;
1585 }
1586 return $output;
1587 }
1588 }