Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save apysais/a51c1d448a2e6cc507e600a806a192f5 to your computer and use it in GitHub Desktop.
Save apysais/a51c1d448a2e6cc507e600a806a192f5 to your computer and use it in GitHub Desktop.
// 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>";
}
}
@mirajadesign
Copy link

This works for one user role. How do we add multiple user roles?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment