PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.3.8
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.3.8
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 / templates / single-course / content-protected.php

content-protected.php in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.3.8, at templates/single-course/content-protected.php

42 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Template for displaying message for course content protected.
4 *
5 * This template can be overridden by copying it to yourtheme/learnpress/single-course/content-protected.php.
6 *
7 * @author ThimPress
8 * @package Learnpress/Templates
9 * @version 4.0.1
10 */
11
12 defined( 'ABSPATH' ) || exit();
13
14 if ( ! isset( $can_view_item ) || $can_view_item->flag ) {
15 return;
16 }
17
18 $message = '';
19
20 if ( ! is_user_logged_in() ) {
21 $message = sprintf(
22 __(
23 'This content is protected, please %1$s and %2$s in the course to view this content!',
24 'learnpress'
25 ),
26 sprintf(
27 '<a class="lp-link-login" href="%s">%s</a>',
28 learn_press_get_login_url( LP_Helper::getUrlCurrent() ),
29 __( 'login', 'learnpress' )
30 ),
31 isset( $course ) ? sprintf(
32 '<a class="lp-link-enroll" href="%s">%s</a>',
33 $course->get_permalink(),
34 __( 'enroll', 'learnpress' )
35 ) : __( 'enroll', 'learnpress' )
36 );
37 } else {
38 $message = $can_view_item->message;
39 }
40
41 learn_press_display_message( $message, 'learn-press-content-protected-message error' );
42