| @@ -1,37 +1,37 @@ | ||
| 1 | -<?php | |
| 2 | -/** | |
| 3 | - * Template for displaying top-bar in archive course page. | |
| 4 | - * | |
| 5 | - * @author ThimPress | |
| 6 | - * @package LearnPress/Templates | |
| 7 | - * @version 4.0.1 | |
| 8 | - */ | |
| 9 | - | |
| 10 | -defined( 'ABSPATH' ) || exit; | |
| 11 | - | |
| 12 | -$layouts = learn_press_courses_layouts(); | |
| 13 | -$active = learn_press_get_courses_layout(); | |
| 14 | -$s = LP_Request::get_param( 'c_search' ); | |
| 15 | -?> | |
| 16 | - | |
| 17 | -<div class="lp-courses-bar <?php echo esc_attr( $active ); ?>"> | |
| 18 | - <form class="search-courses" method="get" action="<?php echo esc_url_raw( learn_press_get_page_link( 'courses' ) ); ?>"> | |
| 19 | - <input type="hidden" name="post_type" value="<?php echo esc_attr( LP_COURSE_CPT ); ?>"> | |
| 20 | - <input type="hidden" name="taxonomy" value="<?php echo esc_attr( get_queried_object()->taxonomy ?? $_GET['taxonomy'] ?? '' ); ?>"> | |
| 21 | - <input type="hidden" name="term_id" value="<?php echo esc_attr( get_queried_object()->term_id ?? $_GET['term_id'] ?? '' ); ?>"> | |
| 22 | - <input type="hidden" name="term" value="<?php echo esc_attr( get_queried_object()->slug ?? $_GET['term'] ?? '' ); ?>"> | |
| 23 | - <input type="text" placeholder="<?php esc_attr_e( 'Search courses...', 'learnpress' ); ?>" name="c_search" value="<?php echo esc_attr( $s ); ?>"> | |
| 24 | - <button type="submit" name="lp-btn-search-courses"><i class="lp-icon-search"></i></button> | |
| 25 | - </form> | |
| 26 | - | |
| 27 | - <div class="switch-layout"> | |
| 28 | - <?php foreach ( $layouts as $layout => $value ) : ?> | |
| 29 | - <input type="radio" name="lp-switch-layout-btn" | |
| 30 | - value="<?php echo esc_attr( $layout ); ?>" | |
| 31 | - id="lp-switch-layout-btn-<?php echo esc_attr( $layout ); ?>" <?php checked( $layout, $active ); ?>> | |
| 32 | - <label class="switch-btn <?php echo esc_attr( $layout ); ?>" | |
| 33 | - title="<?php echo sprintf( esc_attr__( 'Switch to %s', 'learnpress' ), $value ); ?>" | |
| 34 | - for="lp-switch-layout-btn-<?php echo esc_attr( $layout ); ?>"></label> | |
| 35 | - <?php endforeach; ?> | |
| 36 | - </div> | |
| 37 | -</div> | |
| 1 | +<?php | |
| 2 | +/** | |
| 3 | + * Template for displaying top-bar in archive course page. | |
| 4 | + * | |
| 5 | + * @author ThimPress | |
| 6 | + * @package LearnPress/Templates | |
| 7 | + * @version 4.0.1 | |
| 8 | + */ | |
| 9 | + | |
| 10 | +defined( 'ABSPATH' ) || exit; | |
| 11 | + | |
| 12 | +$layouts = learn_press_courses_layouts(); | |
| 13 | +$active = learn_press_get_courses_layout(); | |
| 14 | +$s = LP_Request::get_param( 'c_search' ); | |
| 15 | +?> | |
| 16 | + | |
| 17 | +<div class="lp-courses-bar <?php echo esc_attr( $active ); ?>"> | |
| 18 | + <form class="search-courses" method="get" action="<?php echo esc_url_raw( learn_press_get_page_link( 'courses' ) ); ?>"> | |
| 19 | + <input type="hidden" name="post_type" value="<?php echo esc_attr( LP_COURSE_CPT ); ?>"> | |
| 20 | + <input type="hidden" name="taxonomy" value="<?php echo esc_attr( get_queried_object()->taxonomy ?? $_GET['taxonomy'] ?? '' ); ?>"> | |
| 21 | + <input type="hidden" name="term_id" value="<?php echo esc_attr( get_queried_object()->term_id ?? $_GET['term_id'] ?? '' ); ?>"> | |
| 22 | + <input type="hidden" name="term" value="<?php echo esc_attr( get_queried_object()->slug ?? $_GET['term'] ?? '' ); ?>"> | |
| 23 | + <input type="text" placeholder="<?php esc_attr_e( 'Search courses...', 'learnpress' ); ?>" name="c_search" value="<?php echo esc_attr( $s ); ?>"> | |
| 24 | + <button type="submit" name="lp-btn-search-courses"><i class="lp-icon-search"></i></button> | |
| 25 | + </form> | |
| 26 | + | |
| 27 | + <div class="switch-layout"> | |
| 28 | + <?php foreach ( $layouts as $layout => $value ) : ?> | |
| 29 | + <input type="radio" name="lp-switch-layout-btn" | |
| 30 | + value="<?php echo esc_attr( $layout ); ?>" | |
| 31 | + id="lp-switch-layout-btn-<?php echo esc_attr( $layout ); ?>" <?php checked( $layout, $active ); ?>> | |
| 32 | + <label class="switch-btn <?php echo esc_attr( $layout ); ?>" | |
| 33 | + title="<?php echo sprintf( esc_attr__( 'Switch to %s', 'learnpress' ), $value ); ?>" | |
| 34 | + for="lp-switch-layout-btn-<?php echo esc_attr( $layout ); ?>"></label> | |
| 35 | + <?php endforeach; ?> | |
| 36 | + </div> | |
| 37 | +</div> | |