Created
June 11, 2021 02:39
-
-
Save apysais/a51c1d448a2e6cc507e600a806a192f5 to your computer and use it in GitHub Desktop.
This file contains 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
// hide edit with elementor for editor | |
add_action('wp_head', 'allteams_custom_styles', 100); | |
function allteams_custom_styles() { | |
$user = wp_get_current_user(); | |
if ( in_array( 'editor', (array) $user->roles ) && !is_admin() ) { | |
echo "<style>#wp-admin-bar-elementor_edit_page{display: none !important;}</style>"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This works for one user role. How do we add multiple user roles?