nav-bar.php
4 years ago
profile.php
4 years ago
reset-password.php
4 years ago
social-profile.php
4 years ago
withdraw-settings.php
4 years ago
nav-bar.php
48 lines
| 1 | <?php |
| 2 | $settings_url = tutor_utils()->get_tutor_dashboard_page_permalink( 'settings' ); |
| 3 | $withdraw = tutor_utils()->get_tutor_dashboard_page_permalink( 'settings/withdraw-settings' ); |
| 4 | $reset_password = tutor_utils()->get_tutor_dashboard_page_permalink( 'settings/reset-password' ); |
| 5 | $social = tutor_utils()->get_tutor_dashboard_page_permalink( 'settings/social-profile' ); |
| 6 | |
| 7 | $setting_menus = array( |
| 8 | 'profile' => array( |
| 9 | 'url' => esc_url( $settings_url ), |
| 10 | 'title' => __( 'Profile', 'tutor' ), |
| 11 | 'role' => false, |
| 12 | ), |
| 13 | 'reset_password' => array( |
| 14 | 'url' => esc_url( $reset_password ), |
| 15 | 'title' => __( 'Password', 'tutor' ), |
| 16 | 'role' => false, |
| 17 | ), |
| 18 | 'withdrawal' => array( |
| 19 | 'url' => esc_url( $withdraw ), |
| 20 | 'title' => __( 'Withdraw', 'tutor' ), |
| 21 | 'role' => 'instructor', |
| 22 | ), |
| 23 | 'social-profile' => array( |
| 24 | 'url' => esc_url( $social ), |
| 25 | 'title' => __( 'Social Profile', 'tutor' ), |
| 26 | 'role' => false, |
| 27 | ), |
| 28 | ); |
| 29 | |
| 30 | $setting_menus = apply_filters( 'tutor_dashboard/nav_items/settings/nav_items', $setting_menus ); |
| 31 | $GLOBALS['tutor_setting_nav'] = $setting_menus; |
| 32 | ?> |
| 33 | <ul> |
| 34 | <?php |
| 35 | foreach ( $setting_menus as $menu_key => $menu ) { |
| 36 | $valid = $menu_key == 'profile' || ! $menu['role'] || ( $menu['role'] == 'instructor' && current_user_can( tutor()->instructor_role ) ); |
| 37 | |
| 38 | if ( $valid ) { |
| 39 | ?> |
| 40 | <li class="<?php echo $active_setting_nav == $menu_key ? 'active' : ''; ?>"> |
| 41 | <a href="<?php echo $menu['url']; ?>"> <?php echo $menu['title']; ?></a> |
| 42 | </li> |
| 43 | <?php |
| 44 | } |
| 45 | } |
| 46 | ?> |
| 47 | </ul> |
| 48 |