Home › Forums › Add-ons › Options Page › Adding submenu pages › Reply To: Adding submenu pages
Thank you @elliot – it was the ordering of things which caused the problem.
I wasn’t able to order things right to get an acf options page as a submenu page of a non-ACF menu page, though I suspect it would work fine if I got the order right. I did, however, get my own submenu page as a submenu of the ACF Options menu page – which is what I was aiming for anyway.
For the benefit of anyone else trying to do this here’s what worked for me:-
function add_site_options()
{
//add general site options menu
$parent_slug = 'acf-options';
$page_title = 'Site Tools';
$menu_title = 'Site Tools';
$capability = 'manage_options';
$menu_slug = 'site_options_tools';
$function = 'site_options_tools_html';
add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function);
}
add_action( 'admin_menu', 'add_site_options', 12 )
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.