Created
August 11, 2023 09:51
-
-
Save wbcomdev/ed5aa7d4e6a9af7273d7a62766ec5d8f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Wbcom Designs - Control access mode for instructor | |
| * | |
| * @param array $access_modes where define access. | |
| */ | |
| function wbcom_istructor_access_mode( $access_modes ) { | |
| $access_modes = array( | |
| 'closed' => __( 'Closed', 'ld-dashboard' ), | |
| ); | |
| return $access_modes; | |
| } | |
| $user_roles = wp_get_current_user()->roles; | |
| if ( in_array( 'ld_instructor', $user_roles ) ) { | |
| add_filter( 'ld_dashboard_course_access_modes', 'wbcom_istructor_access_mode' ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment