Support

Account

Home Forums Add-ons Options Page Multiple Options page, not subpage

Solving

Multiple Options page, not subpage

  • Hi, I have problem with options page:

    Normally code below works, but I don’t know how to add secend options page (no subpage). Is there any way to do it ?

    add_filter(‘acf/options_page/settings’,’my_options_page_settings’);

    function my_options_page_settings($options)
    {
    $options[‘title’] = __(‘Partners’);
    $options[‘pages’] = array(
    (‘Partners’)

    );

    return $options;

    }

  • Hey Jack,

    This is fairly simple. You can add multiple subpages by doing the following:

    add_filter(‘acf/options_page/settings’,'my_options_page_settings’);
    
    function my_options_page_settings($options)
    {
    $options['title'] = __(‘Partners’);
    $options['pages'] = array(
    (‘Partners’),
    (‘Page Two’),
    (‘Page Three’),
    (‘Page Four’)
    
    );
    
    return $options;
    
    }

    You just add onto the array.

  • This is not what I’m looking for 🙂
    You wrote how to add elements in Options, not how to add more than one Option page.

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

You must be logged in to reply to this topic.