themeplate/customizer

ThemePlate custom customizer sections with fields

dev-main 2023-01-28 06:23 UTC

This package is auto-updated.

Last update: 2024-05-28 15:53:21 UTC


README

Usage

use ThemePlate\Customizer\CustomSection;

( new CustomSection( 'My Section' ) )->fields( $list )->location( 'panel' )->create();
use ThemePlate\Customizer\CustomSection;

add_action( 'customize_register', function( $customizer ) {
	$customizer->add_panel( 'my-panel', array( 'title' => 'My Panel' ) );

	/** https://developer.wordpress.org/reference/classes/wp_customize_section/__construct/#parameters */
	$args = array(
		'panel'       => 'my-panel',
		'description' => 'This is an example.',
	);

	$section = new CustomSection( 'Another Section', $args );

	$section->fields( $list )->hook( $customizer );
} );