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 )