Skip to content

Add Sections

Ale Mostajo edited this page Apr 4, 2020 · 4 revisions

NOTE: Read the WordPress customizer objects documentation to undestand what a section is.

Add a section

In the app/Config/customizer.php configuration file add a new array setting named sections:

return [
    // Custom sections
    'sections' => [
    ],
];

Then the number of sections needed:

return [
    // Custom sections
    'sections' => [
        'section_id' => [
            'title' => __( 'Custom Section' ),
            'description' => __( 'Description here' ),
            'panel' => 'panel_id',
            'priority' => 160,
        ],
        'custom_css' => [
            'title' => __( 'Custom CSS' ),
            'priority' => 205,
            'capability' => 'edit_theme_options',
        ],
    ],
];
Clone this wiki locally