PHP code example of kunoichi / theme-customizer

1. Go to this page and download the library: Download kunoichi/theme-customizer library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

kunoichi / theme-customizer example snippets




namespace YourNameSpace\Customizer;

use Kunoichi\ThemeCustomizer\CustomizerSetting;

class YourClass extends CustomizerSetting {

	protected $section_id = 'your_custom_setting';
	
	/**
	 * Override this function to register a new section.
	 */
	protected function section_setting() {
		return [
			'title'      => __( 'My Theme Setting', 'domain' ),
			'priority'   => 100,
		];
	}

	/**
	 * Return associative array for each fields.
	 *
	 * @return array
	 */
	protected function get_fields(): array {
		return [
			'yoru_serrint_id' => [
				'label'       => __( 'Ad after title', 'domain' ),
				'stored'      => 'option',  // 'option' or 'theme_mod'(default)
				'type'        => 'textarea' // Type of UI.
			],
		];
	}
}


YourNameSpace\Customizer\YourClass::get_instance();

Kunoichi\ThemeCustomizer::register( 'YourBrand\YourTheme\Customizers' );