PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.2.1
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.2.1
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 / loop / single-course / loop-section.php

loop-section.php in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.2.1, at templates/loop/single-course/loop-section.php

61 lines 1.9 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 curriculum tab of single course.
4 *
5 * @author ThimPress
6 * @package Learnpress/Templates
7 * @version 4.0.3
8 */
9
10 defined( 'ABSPATH' ) || exit();
11
12 if ( empty( $args ) ) {
13 return;
14 }
15
16 if ( isset( $args['section'] ) ) {
17 $section = $args['section'];
18 } else {
19 return;
20 }
21 ?>
22
23 <li id="section-<?php echo esc_attr( $section['section_id'] ); ?>" class="section" data-section-id="<?php echo esc_attr( $section['section_id'] ); ?>">
24 <div class="section-header">
25 <div class="section-left">
26 <div class="wrapper-section-title">
27 <h3 class="section-title">
28 <?php echo ! empty( $section['section_name'] ) ? esc_html( $section['section_name'] ) : _x( 'Untitled', 'template title empty', 'learnpress' ); ?>
29 </h3>
30 <?php if ( ! empty( $section['section_description'] ) ) : ?>
31 <p class="section-desc"><?php echo wp_kses_post( $section['section_description'] ); ?></p>
32 <?php endif; ?>
33 </div>
34
35 <span class="section-toggle">
36 <i class="fas fa-caret-down"></i>
37 <i class="fas fa-caret-up"></i>
38 </span>
39 </div>
40 </div>
41
42 <?php
43 $controller = new LP_REST_Lazy_Load_Controller();
44 $request = new WP_REST_Request();
45 $request->set_param( 'sectionId', $section['section_id'] );
46 $response = $controller->course_curriculum_items( $request );
47 $object_data = $response->get_data();
48 ?>
49 <div class="section-item" data-section-id="<?php echo esc_attr( $section['section_id'] ); ?>">
50 <ul class="section-content">
51 <?php echo wp_kses_post( $object_data->data->content ?? $object_data->data ?? $object_data ? $object_data->data->content : '' ); ?>
52 </ul>
53
54 <?php if ( isset( $object_data ) && ! empty( $object_data->data->pages ) && $object_data->data->pages > 1 ) : ?>
55 <div class="section-item__loadmore" data-page="1">
56 <button><?php esc_html_e( 'Show more items', 'learnpress' ); ?></button>
57 </div>
58 <?php endif; ?>
59 </div>
60 </li>
61