← All changes
|
templates/single-course/content-item/popup-header.php
+61
-61
4.3.8
→
4.4.9
View file →
| @@ -1,61 +1,61 @@ | ||
| 1 | -<?php | |
| 2 | -/** | |
| 3 | - * Template for displaying header of single course popup. | |
| 4 | - * | |
| 5 | - * This template can be overridden by copying it to yourtheme/learnpress/single-course/header.php. | |
| 6 | - * | |
| 7 | - * @author ThimPress | |
| 8 | - * @package Learnpress/Templates | |
| 9 | - * @version 4.0.4 | |
| 10 | - */ | |
| 11 | - | |
| 12 | -defined( 'ABSPATH' ) || exit(); | |
| 13 | - | |
| 14 | -if ( ! isset( $course ) || ! isset( $user ) || ! isset( $percentage ) || | |
| 15 | - ! isset( $completed_items ) || ! isset( $total_items ) ) { | |
| 16 | - return; | |
| 17 | -} | |
| 18 | -?> | |
| 19 | - | |
| 20 | -<div id="popup-header"> | |
| 21 | - <?php | |
| 22 | - /** | |
| 23 | - * @since 4.0.6 | |
| 24 | - * @see single-button-toggle-sidebar - 5 | |
| 25 | - */ | |
| 26 | - do_action( 'learn-press/single-button-toggle-sidebar' ); | |
| 27 | - ?> | |
| 28 | - <div class="popup-header__inner"> | |
| 29 | - <h2 class="course-title"> | |
| 30 | - <a | |
| 31 | - href="<?php echo esc_url_raw( $course->get_permalink() ); ?>"><?php echo wp_kses_post( $course->get_title() ); ?></a> | |
| 32 | - </h2> | |
| 33 | - | |
| 34 | - <?php if ( $user->has_enrolled_or_finished( $course->get_id() ) ) : ?> | |
| 35 | - <div class="items-progress" data-total-items="<?php echo esc_attr( $total_items ); ?>"> | |
| 36 | - <span class="number"> | |
| 37 | - <?php | |
| 38 | - printf( | |
| 39 | - __( | |
| 40 | - '<span class="items-completed">%1$s</span> of %2$d items', | |
| 41 | - 'learnpress' | |
| 42 | - ), | |
| 43 | - esc_html( $completed_items ), | |
| 44 | - esc_html( $course->count_items() ) | |
| 45 | - ); | |
| 46 | - ?> | |
| 47 | - </span> | |
| 48 | - <div class="learn-press-progress"> | |
| 49 | - <div class="learn-press-progress__active" data-value="<?php echo esc_attr( $percentage ); ?>%;"> | |
| 50 | - </div> | |
| 51 | - </div> | |
| 52 | - </div> | |
| 53 | - <?php endif; ?> | |
| 54 | - </div> | |
| 55 | - <a href="<?php echo esc_url_raw( $course->get_permalink() ); ?>" | |
| 56 | - class="back-course" | |
| 57 | - aria-label="<?php esc_attr_e( 'Back to course', 'learnpress' ); ?>" | |
| 58 | - > | |
| 59 | - <i class="lp-icon-times"></i> | |
| 60 | - </a> | |
| 61 | -</div> | |
| 1 | +<?php | |
| 2 | +/** | |
| 3 | + * Template for displaying header of single course popup. | |
| 4 | + * | |
| 5 | + * This template can be overridden by copying it to yourtheme/learnpress/single-course/header.php. | |
| 6 | + * | |
| 7 | + * @author ThimPress | |
| 8 | + * @package Learnpress/Templates | |
| 9 | + * @version 4.0.4 | |
| 10 | + */ | |
| 11 | + | |
| 12 | +defined( 'ABSPATH' ) || exit(); | |
| 13 | + | |
| 14 | +if ( ! isset( $course ) || ! isset( $user ) || ! isset( $percentage ) || | |
| 15 | + ! isset( $completed_items ) || ! isset( $total_items ) ) { | |
| 16 | + return; | |
| 17 | +} | |
| 18 | +?> | |
| 19 | + | |
| 20 | +<div id="popup-header"> | |
| 21 | + <?php | |
| 22 | + /** | |
| 23 | + * @since 4.0.6 | |
| 24 | + * @see single-button-toggle-sidebar - 5 | |
| 25 | + */ | |
| 26 | + do_action( 'learn-press/single-button-toggle-sidebar' ); | |
| 27 | + ?> | |
| 28 | + <div class="popup-header__inner"> | |
| 29 | + <h2 class="course-title"> | |
| 30 | + <a | |
| 31 | + href="<?php echo esc_url_raw( $course->get_permalink() ); ?>"><?php echo wp_kses_post( $course->get_title() ); ?></a> | |
| 32 | + </h2> | |
| 33 | + | |
| 34 | + <?php if ( $user->has_enrolled_or_finished( $course->get_id() ) ) : ?> | |
| 35 | + <div class="items-progress" data-total-items="<?php echo esc_attr( $total_items ); ?>"> | |
| 36 | + <span class="number"> | |
| 37 | + <?php | |
| 38 | + printf( | |
| 39 | + __( | |
| 40 | + '<span class="items-completed">%1$s</span> of %2$d items', | |
| 41 | + 'learnpress' | |
| 42 | + ), | |
| 43 | + esc_html( $completed_items ), | |
| 44 | + esc_html( $course->count_items() ) | |
| 45 | + ); | |
| 46 | + ?> | |
| 47 | + </span> | |
| 48 | + <div class="learn-press-progress"> | |
| 49 | + <div class="learn-press-progress__active" data-value="<?php echo esc_attr( $percentage ); ?>%;"> | |
| 50 | + </div> | |
| 51 | + </div> | |
| 52 | + </div> | |
| 53 | + <?php endif; ?> | |
| 54 | + </div> | |
| 55 | + <a href="<?php echo esc_url_raw( $course->get_permalink() ); ?>" | |
| 56 | + class="back-course" | |
| 57 | + aria-label="<?php esc_attr_e( 'Back to course', 'learnpress' ); ?>" | |
| 58 | + > | |
| 59 | + <i class="lp-icon-times"></i> | |
| 60 | + </a> | |
| 61 | +</div> | |