Skip to content

acf_add_customizer_section

Jörn Lund edited this page Sep 1, 2019 · 3 revisions

acf_add_customizer_section( $section = '' )

Adds a customizer section.
Call this function before or inside the init hook.

Arguments

Return Value

$section_id String If you did not specify a post_id, this will be the second argument to pass to get_field().

Examples

Post meta

acf_add_customizer_section(array(
    'title'        => 'Some Post Meta',
    'storage_type' => 'post',
));

Theme mod

// in the init hook
acf_add_customizer_section(array(
    'title'        => 'Mod the Theme',
    'storage_type' => 'theme_mod',
    'post_id'      => 'acf_theme_mod',
));

// in your theme
the_field('acf_field_selector','acf_theme_mod');
Clone this wiki locally