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:
Comments
Post a Comment