Support

Account

Home Forums Add-ons Options Page Can I add an options page as a sub menu item?

Solved

Can I add an options page as a sub menu item?

  • I tried to use the acf_add_options_sub_page to add an options page to an existing group of admin menu items that are grouped under one parent. It added the page however I can’t configure any fields for it. The selection says “No Options page exist”

    So the question is since I assume I need a main level options page first, can I nest a main level options page under a parent admin item?

  • You should be able to add options pages and they should appear to select them. When are you adding the options pages? On what hook? There can be an issue where defining the options page too late will cause it to not appear as a selection to assign a field group to it.

  • I am adding it under the admin_menu action directly in my function.php file.

    add_action( ‘admin_menu’, ‘chbg_admin_menu’ );

    function chbg_admin_menu() {
    add_menu_page( ‘CHBG’, ‘CHBG’, ‘manage_options’, ‘chbg-admin’, ”, $icon, 40 );
    acf_add_options_sub_page(array(
    ‘page_title’ => ‘Email Settings’,
    ‘menu_title’ => ‘Email Settings’,
    ‘parent_slug’ => ‘chbg-admin’,
    ));
    }

  • Okay, pulling it out of the admin_menu action worked. Thanks!

  • Admin menu is too late. acf/init is where you want it.

  • Thanks!

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.

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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.