Addons.php
4 years ago
Admin.php
4 years ago
Ajax.php
4 years ago
Announcements.php
4 years ago
Assets.php
4 years ago
Backend_Page_Trait.php
4 years ago
Course.php
4 years ago
Course_Filter.php
4 years ago
Course_List.php
4 years ago
Course_Settings_Tabs.php
4 years ago
Course_Widget.php
4 years ago
Custom_Validation.php
5 years ago
Dashboard.php
4 years ago
FormHandler.php
4 years ago
Frontend.php
4 years ago
Gutenberg.php
4 years ago
Instructor.php
4 years ago
Instructors_List.php
4 years ago
Lesson.php
4 years ago
Options_V2.php
4 years ago
Post_types.php
4 years ago
Private_Course_Access.php
4 years ago
Q_and_A.php
4 years ago
Question_Answers_List.php
4 years ago
Quiz.php
4 years ago
Quiz_Attempts_List.php
4 years ago
RestAPI.php
4 years ago
Reviews.php
4 years ago
Rewrite_Rules.php
4 years ago
Shortcode.php
4 years ago
Student.php
4 years ago
Students_List.php
4 years ago
Taxonomies.php
4 years ago
Template.php
4 years ago
Theme_Compatibility.php
5 years ago
Tools.php
4 years ago
Tools_V2.php
4 years ago
Tutor.php
4 years ago
TutorEDD.php
4 years ago
Tutor_Base.php
5 years ago
Tutor_List_Table.php
4 years ago
Tutor_Setup.php
4 years ago
Upgrader.php
4 years ago
User.php
4 years ago
Utils.php
4 years ago
Video_Stream.php
4 years ago
Withdraw.php
4 years ago
Withdraw_Requests_List.php
4 years ago
WooCommerce.php
4 years ago
Frontend.php
51 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Frontend class |
| 4 | * |
| 5 | * @author: themeum |
| 6 | * @author_uri: https://themeum.com |
| 7 | * @package Tutor |
| 8 | * @since v.1.5.2 |
| 9 | */ |
| 10 | |
| 11 | |
| 12 | namespace TUTOR; |
| 13 | |
| 14 | if ( ! defined( 'ABSPATH' ) ) { |
| 15 | exit; |
| 16 | } |
| 17 | |
| 18 | class Frontend { |
| 19 | |
| 20 | public function __construct() { |
| 21 | add_action( 'after_setup_theme', array( $this, 'remove_admin_bar' ) ); |
| 22 | add_filter( 'nav_menu_link_attributes', array( $this, 'add_menu_atts' ), 10, 3 ); |
| 23 | // add_action('pre_get_posts', array($this, 'tutor_offset_courses')); |
| 24 | } |
| 25 | function tutor_offset_courses($query){ |
| 26 | if (!is_admin() && $query->is_main_query() && is_archive(tutor()->course_post_type)) $query->set('offset', 0); |
| 27 | } |
| 28 | /** |
| 29 | * Remove admin bar based on option |
| 30 | */ |
| 31 | function remove_admin_bar() { |
| 32 | $hide_admin_bar_for_users = (bool) get_tutor_option( 'hide_admin_bar_for_users' ); |
| 33 | if ( ! current_user_can( 'administrator' ) && ! is_admin() && $hide_admin_bar_for_users ) { |
| 34 | show_admin_bar( false ); |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | /** |
| 39 | * add_menu_atts |
| 40 | * |
| 41 | * @param mixed $atts |
| 42 | * @param mixed $item |
| 43 | * @param mixed $args |
| 44 | * @return void |
| 45 | */ |
| 46 | function add_menu_atts( $atts, $item, $args ) { |
| 47 | $atts['onClick'] = 'return true'; |
| 48 | return $atts; |
| 49 | } |
| 50 | } |
| 51 |