| @@ -1,49 +1,49 @@ | ||
| 1 | -<?php | |
| 2 | -/** | |
| 3 | - * Template for displaying Retake button in single course. | |
| 4 | - * | |
| 5 | - * This template can be overridden by copying it to yourtheme/learnpress/single-course/buttons/retake.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_retake_times ) ) { | |
| 15 | - return; | |
| 16 | -} | |
| 17 | - | |
| 18 | -$course = learn_press_get_course(); | |
| 19 | -if ( ! $course ) { | |
| 20 | - return; | |
| 21 | -} | |
| 22 | - | |
| 23 | -$message_data_confirm = sprintf( | |
| 24 | - '%s "%s"', | |
| 25 | - esc_html__( 'Do you want to retake the course', 'learnpress' ), | |
| 26 | - $course->get_title() | |
| 27 | -); | |
| 28 | -?> | |
| 29 | - | |
| 30 | -<?php do_action( 'lp/tmpl/course/button-retry/form/before' ); ?> | |
| 31 | - | |
| 32 | -<form name="lp-form-retake-course" class="lp-form-retake-course" method="post" enctype="multipart/form-data" | |
| 33 | - data-confirm="<?php echo esc_attr( $message_data_confirm ); ?>"> | |
| 34 | - | |
| 35 | - <?php do_action( 'lp/tmpl/course/button-retry/before' ); ?> | |
| 36 | - | |
| 37 | - <input type="hidden" name="retake-course" value="<?php echo esc_attr( $course->get_id() ); ?>"/> | |
| 38 | - | |
| 39 | - <button class="lp-button button button-retake-course"> | |
| 40 | - <?php echo sprintf( '%s (%d)', apply_filters( 'learn-press/retake-course-button-text', esc_html__( 'Retake course', 'learnpress' ) ), $can_retake_times ); ?> | |
| 41 | - </button> | |
| 42 | - | |
| 43 | - <div class="lp-ajax-message"></div> | |
| 44 | - | |
| 45 | - <?php do_action( 'lp/tmpl/course/button-retry/after' ); ?> | |
| 46 | - | |
| 47 | -</form> | |
| 48 | - | |
| 49 | -<?php do_action( 'lp/tmpl/course/button-retry/form/after' ); ?> | |
| 1 | +<?php | |
| 2 | +/** | |
| 3 | + * Template for displaying Retake button in single course. | |
| 4 | + * | |
| 5 | + * This template can be overridden by copying it to yourtheme/learnpress/single-course/buttons/retake.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_retake_times ) ) { | |
| 15 | + return; | |
| 16 | +} | |
| 17 | + | |
| 18 | +$course = learn_press_get_course(); | |
| 19 | +if ( ! $course ) { | |
| 20 | + return; | |
| 21 | +} | |
| 22 | + | |
| 23 | +$message_data_confirm = sprintf( | |
| 24 | + '%s "%s"', | |
| 25 | + esc_html__( 'Do you want to retake the course', 'learnpress' ), | |
| 26 | + $course->get_title() | |
| 27 | +); | |
| 28 | +?> | |
| 29 | + | |
| 30 | +<?php do_action( 'lp/tmpl/course/button-retry/form/before' ); ?> | |
| 31 | + | |
| 32 | +<form name="lp-form-retake-course" class="lp-form-retake-course" method="post" enctype="multipart/form-data" | |
| 33 | + data-confirm="<?php echo esc_attr( $message_data_confirm ); ?>"> | |
| 34 | + | |
| 35 | + <?php do_action( 'lp/tmpl/course/button-retry/before' ); ?> | |
| 36 | + | |
| 37 | + <input type="hidden" name="retake-course" value="<?php echo esc_attr( $course->get_id() ); ?>"/> | |
| 38 | + | |
| 39 | + <button class="lp-button button button-retake-course"> | |
| 40 | + <?php echo sprintf( '%s (%d)', apply_filters( 'learn-press/retake-course-button-text', esc_html__( 'Retake course', 'learnpress' ) ), $can_retake_times ); ?> | |
| 41 | + </button> | |
| 42 | + | |
| 43 | + <div class="lp-ajax-message"></div> | |
| 44 | + | |
| 45 | + <?php do_action( 'lp/tmpl/course/button-retry/after' ); ?> | |
| 46 | + | |
| 47 | +</form> | |
| 48 | + | |
| 49 | +<?php do_action( 'lp/tmpl/course/button-retry/form/after' ); ?> | |