So I have registered a two custom option pages however I want to hide one depending on the user capabilities. This is what I have so far…
add_action ('admin_menu', 'remove_homepage_options', 999 );
function remove_homepage_options()
{
if( current_user_can( 'edit_custompost') ) {
remove_menu_page('admin.php?page=acf-options-home-page');
}
}
I have also tried it with remove_submenu_page and it doesn’t work ether. Thoughts??
Hi @GnuandYou
In the latest version of the options page, you can specify sub page specific capabilities!
Read more here:
http://www.advancedcustomfields.com/blog/options-page-add-on-v1-1-0-released/
I noticed when I read the change log… Almost like you read my mind 🙂
Thanks you sir.
While this works for caps I was looking at doing something like your tutorial on hiding options page from clients, but for specific sub menu pages. However I can’t seem to get remove_submenu_page to target the page properly.
I registered an Admin Settings (acf-options-admin-settings) and Client Settings (acf-options-client-settings) sub pages, but when I attempt to remove the sub page it does’t work.