Skip Navigation

[Resolved] Hiding options on dashboard

This thread is resolved. Here is a description of the problem and solution.

Problem: I would like to hide the The7 menu item in the wp-admin area based on User capabilities.

Solution: I'm not sure if the7 offers the ability to control the display of this menu with capabilities. That's something you would need to find out from their support team. If so, you can add that capability here and manage it with Access. If not, then you'll probably need some custom code to remove the menu page. Something like this will hide the menu from everyone except Administrators:

add_action( 'admin_menu', 'remove_the7_menu_pages', 999 );
 
function remove_the7_menu_pages() {
  if(!current_user_can('administrator')) {
    remove_menu_page( 'the7-dashboard' );
  }
}

Relevant Documentation:
https://codex.wordpress.org/Plugin_API/Action_Reference/admin_menu

This support ticket is created 6 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 1 reply, has 2 voices.

Last updated by Christian Cox 6 years, 3 months ago.

Assisted by: Christian Cox.

Author
Posts
#1078555
Capture.PNG
custom.PNG
change.PNG

I am using Access to create a custom role which is fine but I cant work out how to hide an element that doesn't appear in the change permissions options. I'm assuming it is done somehow through Custom Capabilities > Add new custom capability but I cant find any documentation on how to do this.

What I am trying to do is hide the7 theme option that is ringed in red in the 1st attached screenshot

Thanks

#1078609

Hi, I'm not sure if the7 offers the ability to control the display of this menu with capabilities. That's something you would need to find out from their support team. If so, you can add that capability here and manage it with Access. If not, then you'll probably need some custom code to remove the menu page. Something like this will hide the menu from everyone except Administrators:

add_action( 'admin_menu', 'remove_the7_menu_pages', 999 );

function remove_the7_menu_pages() {
  if(!current_user_can('administrator')) {
    remove_menu_page( 'the7-dashboard' );
  }
}