I would like to hide the “Edit with TagDiv Composer” for any users (editors, authors e.t.c) apart from Admins.
How I can achive it?
There is any way to hide it completly for non admins?
using CSS ? or using remove_menu()? or using remove_node()?
This was working before remove_menu(‘tdb_template_builder’);
What’s the correct ID of tdb_template_builder ?
Hello,
I understand that, but I want to remove it for editors as well.
I have many editorial sites based in your theme, so many editors has access to those sites. I don’t want them to view the composer.
Anamaria the answers you are givving me has nothing to do with my question.
I don’t want to hide the admin bar!!
I only want to hide your composer button!!
Hello Mario, Could you share the solution with us? It could help me and many other users who are looking for a way to do this!
Hello, I am still working on the solution, I will post it once its ready
@Anamaria, FYI
function hide_menu_and_admin_bar_items_for_editor() {
// Check if the current user is an editor
if (current_user_can('editor') && !current_user_can('administrator')) {
add_action('admin_bar_menu', function ($wp_admin_bar1) {
if ( is_admin_bar_showing() ) {
echo '<style>
#wp-admin-bar-td_live_css_css_writer, #wp-admin-bar-tdc_edit, #wp-admin-bar-tdc_page_mobile_template {
display: none !important;
}
</style>';
}
}, 9999);
}
}
add_action('init', 'hide_menu_and_admin_bar_items_for_editor');