Description

This hook allows you to override the global settings array used by ACF throughout the plugin.

Requirements

  • ACF version 3.5.4 or above

Available options

Bellow is the default $options array found in ACF. You can override any of these values

array(
	'options_page' => array(
		'capability' => 'edit_posts', // capability to view options page
		'title' => __('Options','acf'), // title / menu name ('Site Options')
		'pages' => array(), // an array of sub pages ('Header, Footer, Home, etc')
	),
	'activation_codes' => array(
		'repeater'		=> '', // activation code for the repeater add-on (XXXX-XXXX-XXXX-XXXX)
		'options_page'		=> '', // activation code for the options page add-on (XXXX-XXXX-XXXX-XXXX)
		'flexible_content'	=> '', // activation code for the flexible content add-on (XXXX-XXXX-XXXX-XXXX)
		'gallery'		=> '', // activation code for the gallery add-on (XXXX-XXXX-XXXX-XXXX)
	),
);

Usage

<?php
 
function my_acf_settings( $options )
{
    // activate add-ons
    $options['activation_codes']['repeater'] = 'XXXX-XXXX-XXXX-XXXX';
    $options['activation_codes']['options_page'] = 'XXXX-XXXX-XXXX-XXXX';
 
    // set options page structure
    $options['options_page']['title'] = 'Global Options';
    $options['options_page']['pages'] = array('Header', 'Footer');
 
    return $options;
 
}
add_filter('acf_settings', 'my_acf_settings');
 
?>