wordpress - Hide admin menu items and restrict access based on Role -


i know way show/hide menu items in admin based on user roles, can type address , access specific menu. wondering if there way restrict well.

for moment i'm using code:

add_action( 'admin_init', 'my_remove_menu_pages' );  function my_remove_menu_pages() {     // if user not have access publish posts     if(!current_user_can('add_users')) {         // remove "tools" menu         remove_menu_page('tools.php');     } } 

how going other way:

http://codex.wordpress.org/function_reference/add_role


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -