Hi, How can i remove the themeco menu on dashboard for a specific user logged? thanks
Hi @xonetit,
Thanks for reaching out!
You can do that by configuring your user role permissions. To do that, please check this documentation.
Hope that helps.
Thank you.
I donât think you can disable the toolbar from the settings. Anyway I created this code but for the toolbar I have problems disabling it, any help? thank you.
$user_ID = get_current_user_id();
if ($user_ID == 0) { //add id
//remove menu dashboard pro
function wpdocs_remove_menus(){
remove_menu_page(âx-addons-homeâ);
//remove_menu_page(âthemes.phpâ);
}
add_action( âadmin_menuâ, âwpdocs_remove_menusâ, 999);
?>
//remove theme pro form list theme
add_filter( âwp_prepare_themes_for_jsâ, âhideThemesâ);
function hideThemes($arr){
unset($arr[âproâ]);
return $arr;
}
//remove toolbar pro
function remove_tbm() {
global $wp_admin_bar;
$wp_admin_bar->remove_menu(âtco-mainâ);
}
add_action(âwp_before_admin_bar_renderâ, âremove_tbmâ, 999);
}
Hello @xonetit,
You can also do this with custom PHP code, try adding the following code in your child themeâs functions.php file:
// remove the Pro Icon for all other roles except Admins
function remove_pro_icon() {
if( !current_user_can('administrator') ) {
echo '<style>
#wp-admin-bar-tco-main, li#toplevel_page_x-addons-home {
display: none;
}
</style>';
}
}
add_action('wp_head', 'remove_pro_icon');
add_action('admin_head', 'remove_pro_icon');
The above code will remove the Pro icon for all roles except for the Admin roles. You can tweak the code to support other roles as you need.
Please note that the code provided above serves as a guide only and is to help you in getting started so implementing it and maintaining the code will be out of our support scope and for further maintenance for new possible versions of the theme that may cause the customization to break, you will need to hire a developer.
Hope this helps
Thanks
thanks works, adesso funziona bene anche questo
function remove_tbm() {
global $wp_admin_bar;
$wp_admin_bar->remove_menu(âtco-mainâ);
}
add_action(âwp_before_admin_bar_renderâ, âremove_tbmâ, 999);
since there are I can ask if there is a hooks to remove the pro editor element in the post pages and pages?
Hi Gianluca,
You can use the User Permissions and disable everything from the General, which should prevent your user from editing a page. And since you already hide the PRO item on the dashboard, there is no way for them to enable it back (unless they know how).
Thanks,
I noticed that even if all permissions are disabled, the user can still enter the editor and modify the css. Is this normal?
Hi Gianluca,
That seems to be a bug, Iâve submitted this to our issue tracker so the developers will be made aware of it.
Thank you for understanding,
Hi @xonetit,
I can confirm the permissions for Theme Options edit css and javascript were not being applied. Weâve corrected this for the next release. Iâve also made an adjustment that will hide the toolbar in the event the user doesnât have permissions for any of the sub links.
this is great.
I take this opportunity to give two ideas that could be taken into consideration.
a) Provide permissions at the username (ID) level as well as at the permissions level. This is to be able to exclude / include some users with the same WP permissions.
b) Restrict / exclude the themeco dashboard / toolbar / editbar in user permissions. A Grand Master user may override the functionality to another Admin user.
c) Exclude the unlicensed dashboard and editor tools.
c) Have the possibility of a white label for thema PRO
This is to provide a professional tool for developer professionals.
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.