acf_add_customizer_panel - mcguffin/acf-customizer GitHub Wiki
acf_add_customizer_panel( $panel = '' )
Adds a customizer panel.
Call this function before or inside the init hook.
Arguments
-
$panel = ''
String|Array As a string: the name of the Customizer panel.
Array argument values:-
title
(mandatory) String. -
id
(optional) String. Defaults to sanitized title argument with unique suffix appended. -
active_callback
(optional) callable
see https://developer.wordpress.org/reference/classes/wp_customize_manager/add_section/ -
capability
(optional) String. Default:'edit_theme_options'
see https://developer.wordpress.org/reference/classes/wp_customize_manager/add_section/ -
theme_supports
(optional) array
Default:array()
see https://developer.wordpress.org/reference/classes/wp_customize_manager/add_section/ -
description
(optional) String
Default:''
see https://developer.wordpress.org/reference/classes/wp_customize_manager/add_section/ -
priority
(optional) integer
Default:160
see https://developer.wordpress.org/reference/classes/wp_customize_manager/add_section/
-
Return Value
$panel_id
String
The Panel ID.
Example
$panel_id = acf_add_customizer_panel(array(
'title' => 'Theme-Options',
));
acf_add_customizer_section(array(
'title' => 'Basic',
'storage_type' => 'option',
'panel' => $panel_id,
));
acf_add_customizer_section(array(
'title' => 'Advanced',
'storage_type' => 'option',
'panel' => $panel_id,
));