PluginProbe
Tutor LMS – eLearning and online course solution / 4.0.6
Tutor LMS – eLearning and online course solution v4.0.6
4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 4.0.2 4.0.1 4.0.0 3.9.15 3.9.14 3.9.13 3.9.12 3.9.11 trunk 1.0.0 1.0.0-alpha 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 All 191 releases
tutor / templates / learning-area / components / sidebar-nav-item.php
sidebar-nav-item.php
48 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Render a single nav item for learning area sidebar.
4 *
5 * @package Tutor\Templates
6 * @subpackage LearningArea
7 * @author Themeum <support@themeum.com>
8 * @link https://themeum.com
9 * @since 4.0.2
10 */
11
12 defined( 'ABSPATH' ) || exit;
13
14 use Tutor\Components\SvgIcon;
15
16 $item = $item ?? null;
17 $active = $active ?? false;
18 $can_access = $can_access ?? false;
19 $is_completed = $is_completed ?? false;
20 $type_label = $type_label ?? '';
21 $icon = $icon ?? '';
22 $status_class = $status_class ?? '';
23
24 if ( ! $item || ! is_a( $item, 'WP_Post' ) ) {
25 return;
26 }
27
28 $active_class = $active ? 'active' : '';
29 $item_title = $item->post_title;
30 $allowed_html = array(
31 'span' => array(
32 'class' => array(),
33 ),
34 );
35 ?>
36
37 <a
38 href="<?php echo esc_url( get_permalink( $item->ID ) ); ?>"
39 title="<?php echo esc_attr( $item_title ); ?>"
40 class="<?php echo esc_attr( sprintf( 'tutor-learning-nav-item %s %s', $active_class, $status_class ) ); ?>"
41 >
42 <?php SvgIcon::make()->name( $icon )->size( 20 )->render(); ?>
43 <div class="tutor-overflow-hidden">
44 <div><?php echo esc_html( $item_title ); ?></div>
45 <div class="tutor-tiny-2 tutor-text-subdued"><?php echo wp_kses( $type_label, $allowed_html ); ?></div>
46 </div>
47 </a>
48