Addons.php
1 year ago
Admin.php
1 year ago
Ajax.php
1 year ago
Announcements.php
1 year ago
Assets.php
1 year ago
Backend_Page_Trait.php
1 year ago
BaseController.php
1 year ago
Course.php
1 year ago
Course_Embed.php
3 years ago
Course_Filter.php
1 year ago
Course_List.php
1 year ago
Course_Settings_Tabs.php
1 year ago
Course_Widget.php
1 year ago
Custom_Validation.php
3 years ago
Dashboard.php
1 year ago
Earnings.php
1 year ago
FormHandler.php
2 years ago
Frontend.php
1 year ago
Gutenberg.php
1 year ago
Input.php
1 year ago
Instructor.php
1 year ago
Instructors_List.php
1 year ago
Lesson.php
1 year ago
Options_V2.php
1 year ago
Permalink.php
2 years ago
Post_types.php
1 year ago
Private_Course_Access.php
1 year ago
Q_And_A.php
1 year ago
Question_Answers_List.php
3 years ago
Quiz.php
1 year ago
QuizBuilder.php
1 year ago
Quiz_Attempts_List.php
1 year ago
RestAPI.php
2 years ago
Reviews.php
3 years ago
Rewrite_Rules.php
2 years ago
Shortcode.php
1 year ago
Singleton.php
1 year ago
Student.php
1 year ago
Students_List.php
1 year ago
Taxonomies.php
1 year ago
Template.php
1 year ago
Theme_Compatibility.php
3 years ago
Tools.php
1 year ago
Tools_V2.php
1 year ago
Tutor.php
1 year ago
TutorEDD.php
1 year ago
Tutor_Base.php
2 years ago
Tutor_Setup.php
1 year ago
Upgrader.php
1 year ago
User.php
1 year ago
Utils.php
1 year ago
Video_Stream.php
3 years ago
WhatsNew.php
2 years ago
Withdraw.php
1 year ago
Withdraw_Requests_List.php
1 year ago
WooCommerce.php
1 year ago
Dashboard.php
66 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Manage Frontend Dashboard |
| 4 | * |
| 5 | * @package Tutor |
| 6 | * @author Themeum <support@themeum.com> |
| 7 | * @link https://themeum.com |
| 8 | * @since 1.3.4 |
| 9 | */ |
| 10 | |
| 11 | namespace TUTOR; |
| 12 | |
| 13 | if ( ! defined( 'ABSPATH' ) ) { |
| 14 | exit; |
| 15 | } |
| 16 | /** |
| 17 | * Dashboard Class |
| 18 | * |
| 19 | * @since 1.3.4 |
| 20 | */ |
| 21 | class Dashboard { |
| 22 | |
| 23 | /** |
| 24 | * Constructor |
| 25 | * |
| 26 | * @since 1.3.4 |
| 27 | * @return void |
| 28 | */ |
| 29 | public function __construct() { |
| 30 | add_action( 'tutor_load_template_after', array( $this, 'tutor_load_template_after' ), 10, 2 ); |
| 31 | add_filter( 'should_tutor_load_template', array( $this, 'should_tutor_load_template' ), 10, 2 ); |
| 32 | } |
| 33 | |
| 34 | /** |
| 35 | * Load template after |
| 36 | * |
| 37 | * @since 1.3.4 |
| 38 | * @return void |
| 39 | */ |
| 40 | public function tutor_load_template_after() { |
| 41 | global $wp_query; |
| 42 | |
| 43 | $tutor_dashboard_page = tutor_utils()->array_get( 'query_vars.tutor_dashboard_page', $wp_query ); |
| 44 | if ( 'create-course' === $tutor_dashboard_page ) { |
| 45 | wp_reset_query(); |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | /** |
| 50 | * Check template need to load or not |
| 51 | * |
| 52 | * @since 1.3.4 |
| 53 | * |
| 54 | * @param bool $bool true or false. |
| 55 | * @param string $template template name. |
| 56 | * |
| 57 | * @return boolean |
| 58 | */ |
| 59 | public function should_tutor_load_template( $bool, $template ) { |
| 60 | if ( 'dashboard.create-course' === $template && ! tutor()->has_pro ) { |
| 61 | return false; |
| 62 | } |
| 63 | return $bool; |
| 64 | } |
| 65 | } |
| 66 |