Support

Account

Home Forums ACF PRO Options Page doesn't show up in WP admin menu

Solved

Options Page doesn't show up in WP admin menu

  • Hi everyone,

    I’ve been working for a while with ACF and some add-ons (Options Page, Repeater Field…) though recently I’ve moved to ACF PRO version 5.3.9.2.

    Since then my acf/options_page/settings stopped to work and the menu doesn’t show up anymore in the WP Admin sidebar.

    According to the documentation the code I’m using is for the ACF free version. Does anybody know how to do the same for the ACF PRO version?

    This is my code:

    function mysite_options_page_settings($settings) {
      $settings['title'] = 'Global';
      $settings['pages'] = array('Header', 'Footer');
      return $settings;
    }
    
    add_filter('acf/options_page/settings', 'mysite_options_page_settings');

    Any help?

  • Hi,

    Try this:

    if( function_exists('acf_add_options_page') ) {
      // Adds ACF Pro options page for Global Options
      $globalOptions = acf_add_options_page(array(
          'page_title'  => 'Global Options',
          'menu_title' => 'Global Options',
          'menu_slug'  => 'global-options',
          'capability' => 'edit_posts',
          'redirect'  => false
      ));
    
      // Adds ACF Pro sub options page for Header
      acf_add_options_sub_page(array(
        'page_title'  => 'Header Settings',
        'menu_title'  => 'Header',
        'parent_slug'   => $globalOptions['menu_slug'],
      ));
      // Adds ACF Pro sub options page for Footer
      acf_add_options_sub_page(array(
        'page_title'  => 'Footer Settings',
        'menu_title'  => 'Footer',
        'parent_slug'   => $globalOptions['menu_slug'],
      ));
    }
  • The difference between ACF4 and 5 is that 5 no longer adds a default options page. To add the options page that used to be there by default (borrowing @ajhisbrill code)

    
    f( function_exists('acf_add_options_page') ) {
      // Adds ACF Pro options page that used to appear by default in the ACF4 add on
      $globalOptions = acf_add_options_page(array(
          'page_title'  => 'Options',
          'menu_title' => 'Options',
          'menu_slug'  => 'acf-options',
          'capability' => 'edit_posts',
          'redirect'  => false
      ));
    }
    

    You may need to edit the field groups that are supposed to appear on options pages and reattach them to the correct options page. There are some changes between 4 and 5 that sometimes causes this.

  • Thanks for your quick answer @ajhisbrill
    Your solution definitely solved my problem!


    @hube2

    You may need to edit the field groups that are supposed to appear on options pages and reattach them to the correct options page. There are some changes between 4 and 5 that sometimes causes this.

    That was not my case though thank you anyway for the advice 🙂

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

The topic ‘Options Page doesn't show up in WP admin menu’ is closed to new replies.