Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task done
formgarten opened this issue Apr 5, 2023 · 0 comments
Open
1 task done

Comments

@formgarten
Copy link

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

  • I agree to follow this project's Code of Conduct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant