From cf1e93d94a8865f1b45e6e4ba6bb5800e23740bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BAben=20Martins?= Date: Mon, 24 Feb 2020 19:27:29 +0000 Subject: [PATCH] Allow to set witch user role in admin course tabs --- inc/admin/lp-admin-actions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/admin/lp-admin-actions.php b/inc/admin/lp-admin-actions.php index a1e81fdc0..1db8a8dcd 100644 --- a/inc/admin/lp-admin-actions.php +++ b/inc/admin/lp-admin-actions.php @@ -238,7 +238,7 @@ function learn_press_admin_course_tabs() { $current_page_id = get_current_screen()->id; $current_user = wp_get_current_user(); - if ( ! in_array( 'administrator', $current_user->roles ) ) { + if ( ! in_array( apply_filters( 'learn_press_admin_tabs_user_role', 'administrator' ), $current_user->roles ) ) { return; } if ( ! empty( $admin_tabs_on_page[ $current_page_id ] ) && count( $admin_tabs_on_page[ $current_page_id ] ) ) { @@ -362,4 +362,4 @@ function learn_press_fill_in_blanks_settings( $object ) { } add_action( 'rwmb_before', 'learn_press_fill_in_blanks_settings' ); -add_action( 'rwmb_before_save_post', 'learn_press_fill_in_blanks_settings' ); \ No newline at end of file +add_action( 'rwmb_before_save_post', 'learn_press_fill_in_blanks_settings' );