acf/options_page/settings

Last updated Jun 28, 2017

Overview

This filter allows you to modify the setting used by the options page add-on.

Changelog

Notes

This filter has been deprecated in ACF PRO as it is no longer needed. ACF PRO does not add an options page by default and requires each options page to be added using the add_options_page() and add_options_sub_page() functions.

Parameters

apply_filters('acf/options_page/settings', $settings);
  • $settings (array)  an array of settings described below

$settings

$settings = array(
    
    /* (string) the options page title. Defaults to 'Options' */
    'title' => __('Options', 'acf'),
    
    /* (string) the options page menu title. Defaults to 'Options' */
    'menu' => __('Options', 'acf'),
    
    /* (string) the options page url slug. Defaults to 'acf-options' */
    'slug' => 'acf-options',
    
    /* the capability needed to access this admin page. Defaults to 'edit_posts' */
    'capability' => 'edit_posts',
    
    /* an array of sub menu pages (strings or arrays). Defaults to an empty array */
    'pages' => array()
);

Usage

This example will change the menu item title to ‘Global’ and add 3 sub pages!

function my_acf_options_page_settings( $settings )
{
    $settings['title'] = 'Global';
    $settings['pages'] = array('Header', 'Sidebar', 'Footer');

    return $settings;
}

add_filter('acf/options_page/settings', 'my_acf_options_page_settings');

Related