themeplate / customizer
ThemePlate custom customizer sections with fields
dev-main
2023-01-28 06:23 UTC
Requires
- php: ^7.4|^8.0
- themeplate/core: ^2.0
Requires (Dev)
- themeplate/tester: ^2.0
This package is auto-updated.
Last update: 2024-10-28 16:44:47 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 ); } );