Skip to content

Snippet: Add Customizer Settings

// Add new settings to the Customizer Total panels.
function myprefix_customizer_settings( $sections ) {
	
	// Add new setting under the header > logo section
	$sections['wpex_header_logo']['settings']['myprefix_setting_id'] = array(
		'id' => 'myprefix_setting_id',
		'default' => 'default_value',
		'control' => array(
			'label' => __( 'Setting Name', 'total' ),
			'type' => 'text', // text, checkbox, textarea, dropdown, number, wpex-heading, wpex-fa-icon-select, wpex-sortable
			'choices' => array(), // used for dropdowns
		),
	);

	// Return settings
	return $sections;

}
add_filter( 'wpex_customizer_sections', 'myprefix_customizer_settings' );
All PHP snippets should be added via child theme's functions.php file or via a plugin. We recommend Code Snippets (100% Free) or WPCode (sponsored)
Back To Top