PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.8
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.8
4.4.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 All 139 releases
← All changes | templates/profile/tabs/sections.php +75 -75 4.3.84.4.8 View file →
@@ -1,75 +1,75 @@
1 -<?php
2 -/**
3 - * Template for displaying sections in the top of user profile tab content.
4 - *
5 - * This template can be overridden by copying it to yourtheme/learnpress/tabs/sections.php.
6 - *
7 - * @author ThimPress
8 - * @package Learnpress/Templates
9 - * @version 4.0.2
10 - */
11 -
12 -defined( 'ABSPATH' ) || exit();
13 -
14 -$profile = LP_Profile::instance();
15 -
16 -
17 -if ( ! isset( $tab_key, $tab_data ) ) {
18 - return;
19 -}
20 -
21 -if ( empty( $tab_data->get( 'sections' ) ) || ( sizeof( $tab_data->get( 'sections' ) ) < 2 ) ) {
22 - return;
23 -}
24 -
25 -$link = $profile->get_tab_link( $tab_key );
26 -$unique_group = uniqid( 'course-tab-' );
27 -$sections = $tab_data->get( 'sections' );
28 -$visible_tabs = array();
29 -$active_tab = '';
30 -?>
31 -
32 -<div class="learn-press-tabs">
33 - <?php
34 - foreach ( $sections as $section_key => $section_data ) {
35 - if ( $profile->is_hidden( $section_data ) ) {
36 - continue;
37 - }
38 -
39 - $visible_tabs[] = $section_key;
40 - $checked = '';
41 -
42 - if ( $profile->is_current_section( $section_key, $section_key ) ) {
43 - $active_tab = $section_key;
44 -// $checked = checked( true, true, false );
45 -// echo '<div class="mb-current-tab"><label>'.esc_html( $section_data['title'] ).'</label></div>';
46 - }
47 - ?>
48 - <?php } ?>
49 -
50 - <ul class="learn-press-tabs__nav" data-tabs="<?php echo esc_attr( count( $visible_tabs ) ); ?>">
51 - <?php
52 - foreach ( $sections as $section_key => $section_data ) {
53 - if ( ! in_array( $section_key, $visible_tabs ) ) {
54 - continue;
55 - }
56 -
57 - $classes = array( 'learn-press-tabs__item', esc_attr( $section_key ) );
58 -
59 - if ( $active_tab == $section_key ) {
60 - $classes[] = 'active';
61 - }
62 -
63 - $section_slug = $profile->get_slug( $section_data, $section_key );
64 - $section_link = $profile->get_tab_link( $tab_key, $section_slug );
65 - ?>
66 -
67 - <li class="<?php echo esc_attr( implode( ' ', $classes ) ); ?>">
68 - <a href="<?php echo esc_url_raw( $section_link ); ?>"><?php echo esc_html( $section_data['title'] ); ?></a>
69 - </li>
70 -
71 - <?php } ?>
72 -
73 - </ul>
74 -</div>
75 -
1 +<?php
2 +/**
3 + * Template for displaying sections in the top of user profile tab content.
4 + *
5 + * This template can be overridden by copying it to yourtheme/learnpress/tabs/sections.php.
6 + *
7 + * @author ThimPress
8 + * @package Learnpress/Templates
9 + * @version 4.0.2
10 + */
11 +
12 +defined( 'ABSPATH' ) || exit();
13 +
14 +$profile = LP_Profile::instance();
15 +
16 +
17 +if ( ! isset( $tab_key, $tab_data ) ) {
18 + return;
19 +}
20 +
21 +if ( empty( $tab_data->get( 'sections' ) ) || ( sizeof( $tab_data->get( 'sections' ) ) < 2 ) ) {
22 + return;
23 +}
24 +
25 +$link = $profile->get_tab_link( $tab_key );
26 +$unique_group = uniqid( 'course-tab-' );
27 +$sections = $tab_data->get( 'sections' );
28 +$visible_tabs = array();
29 +$active_tab = '';
30 +?>
31 +
32 +<div class="learn-press-tabs">
33 + <?php
34 + foreach ( $sections as $section_key => $section_data ) {
35 + if ( $profile->is_hidden( $section_data ) ) {
36 + continue;
37 + }
38 +
39 + $visible_tabs[] = $section_key;
40 + $checked = '';
41 +
42 + if ( $profile->is_current_section( $section_key, $section_key ) ) {
43 + $active_tab = $section_key;
44 +// $checked = checked( true, true, false );
45 +// echo '<div class="mb-current-tab"><label>'.esc_html( $section_data['title'] ).'</label></div>';
46 + }
47 + ?>
48 + <?php } ?>
49 +
50 + <ul class="learn-press-tabs__nav" data-tabs="<?php echo esc_attr( count( $visible_tabs ) ); ?>">
51 + <?php
52 + foreach ( $sections as $section_key => $section_data ) {
53 + if ( ! in_array( $section_key, $visible_tabs ) ) {
54 + continue;
55 + }
56 +
57 + $classes = array( 'learn-press-tabs__item', esc_attr( $section_key ) );
58 +
59 + if ( $active_tab == $section_key ) {
60 + $classes[] = 'active';
61 + }
62 +
63 + $section_slug = $profile->get_slug( $section_data, $section_key );
64 + $section_link = $profile->get_tab_link( $tab_key, $section_slug );
65 + ?>
66 +
67 + <li class="<?php echo esc_attr( implode( ' ', $classes ) ); ?>">
68 + <a href="<?php echo esc_url_raw( $section_link ); ?>"><?php echo esc_html( $section_data['title'] ); ?></a>
69 + </li>
70 +
71 + <?php } ?>
72 +
73 + </ul>
74 +</div>
75 +