| @@ -5,9 +5,9 @@ | ||
| 5 | 5 | * This template can be overridden by copying it to yourtheme/learnpress/tabs/sections.php. |
| 6 | 6 | * |
| 7 | 7 | * @author ThimPress |
| 8 | 8 | * @package Learnpress/Templates |
| 9 | - * @version 4.0.1 | |
| 9 | + * @version 4.0.2 | |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | defined( 'ABSPATH' ) || exit(); |
| 13 | 13 | |
| @@ -17,15 +17,15 @@ | ||
| 17 | 17 | if ( ! isset( $tab_key, $tab_data ) ) { |
| 18 | 18 | return; |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | -if ( empty( $tab_data['sections'] ) || ( sizeof( $tab_data['sections'] ) < 2 ) ) { | |
| 21 | +if ( empty( $tab_data->get( 'sections' ) ) || ( sizeof( $tab_data->get( 'sections' ) ) < 2 ) ) { | |
| 22 | 22 | return; |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | $link = $profile->get_tab_link( $tab_key ); |
| 26 | 26 | $unique_group = uniqid( 'course-tab-' ); |
| 27 | -$sections = $tab_data['sections']; | |
| 27 | +$sections = $tab_data->get( 'sections' ); | |
| 28 | 28 | $visible_tabs = array(); |
| 29 | 29 | $active_tab = ''; |
| 30 | 30 | ?> |
| 31 | 31 | |
| @@ -35,20 +35,17 @@ | ||
| 35 | 35 | if ( $profile->is_hidden( $section_data ) ) { |
| 36 | 36 | continue; |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | - $visible_tabs[] = $section_key; | |
| 40 | - $checked = ''; | |
| 39 | + $visible_tabs[] = $section_key; | |
| 40 | + $checked = ''; | |
| 41 | 41 | |
| 42 | 42 | if ( $profile->is_current_section( $section_key, $section_key ) ) { |
| 43 | 43 | $active_tab = $section_key; |
| 44 | - $checked = checked( true, true, false ); | |
| 44 | +// $checked = checked( true, true, false ); | |
| 45 | +// echo '<div class="mb-current-tab"><label>'.esc_html( $section_data['title'] ).'</label></div>'; | |
| 45 | 46 | } |
| 46 | 47 | ?> |
| 47 | - | |
| 48 | - <input type="radio" name="<?php echo esc_attr( $unique_group ); ?>" | |
| 49 | - class="learn-press-tabs__checker" <?php echo esc_attr( $checked ); ?> | |
| 50 | - id="<?php echo esc_attr( $unique_group . '__' . $section_key ); ?>"/> | |
| 51 | 48 | <?php } ?> |
| 52 | 49 | |
| 53 | 50 | <ul class="learn-press-tabs__nav" data-tabs="<?php echo esc_attr( count( $visible_tabs ) ); ?>"> |
| 54 | 51 | <?php |
| @@ -56,9 +53,9 @@ | ||
| 56 | 53 | if ( ! in_array( $section_key, $visible_tabs ) ) { |
| 57 | 54 | continue; |
| 58 | 55 | } |
| 59 | 56 | |
| 60 | - $classes = array( 'learn-press-tabs__tab', esc_attr( $section_key ) ); | |
| 57 | + $classes = array( 'learn-press-tabs__item', esc_attr( $section_key ) ); | |
| 61 | 58 | |
| 62 | 59 | if ( $active_tab == $section_key ) { |
| 63 | 60 | $classes[] = 'active'; |
| 64 | 61 | } |
| @@ -67,9 +64,9 @@ | ||
| 67 | 64 | $section_link = $profile->get_tab_link( $tab_key, $section_slug ); |
| 68 | 65 | ?> |
| 69 | 66 | |
| 70 | 67 | <li class="<?php echo esc_attr( implode( ' ', $classes ) ); ?>"> |
| 71 | - <label><a href="<?php echo esc_url_raw( $section_link ); ?>"><?php echo esc_html( $section_data['title'] ); ?></a></label> | |
| 68 | + <a href="<?php echo esc_url_raw( $section_link ); ?>"><?php echo esc_html( $section_data['title'] ); ?></a> | |
| 72 | 69 | </li> |
| 73 | 70 | |
| 74 | 71 | <?php } ?> |
| 75 | 72 | |