wp-media / adminimize

Adminimize is a WordPress plugin that lets you hide 'unnecessary' items from the WordPress backend.
https://wordpress.org/plugins/adminimize/
GNU General Public License v2.0
100 stars 30 forks source link

[Bug]: Elementor Edit Button in Frontend Admin Bar can't be hidden #157

Open formgarten opened 1 year ago

formgarten commented 1 year ago

Description of the bug

The elementor plugin has an edit button with a sub menu in the frontend admin bar. Adminimize can't hide it.

Reproduction instructions

The ID of the elementor button is "#wp-admin-bar-elementor_edit_page". I set it up as a global option inside adminimize to hide that ID for non admin users, but that doesn't work.

Using following code snippet inside the functions.php is doing it at all.

add_action('wp_head', 'allteams_custom_styles', 100); function allteams_custom_styles() { $user = wp_get_current_user(); if ( ( in_array( 'editor', (array) $user->roles ) || in_array( 'author', (array) $user->roles ) || in_array( 'subscriber', (array) $user->roles ) ) && !is_admin() ) { echo "<style>#wp-admin-bar-elementor_edit_page{display: none !important;}</style>"; } }

Expected behavior

all said above ...

Environment info

No response

Relevant log output

No response

Additional context

No response

Code of Conduct