PHP code example of symbioticwp / customizer-builder

1. Go to this page and download the library: Download symbioticwp/customizer-builder 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/ */

    

symbioticwp / customizer-builder example snippets



if (file_exists($composer = __DIR__ . '/vendor/autoload.php')) {
    


use Symbiotic\Customizer\CustomizerBuilder;

add_action("customize_register", function($wp_customize)
{
	$builder = new CustomizerBuilder($wp_customize);

	$builder->newPanel("post_types", "Post Types", function() use ($builder) {
		$builder->addSection("Posts", "Header", function() use ($builder) {
			$builder->addTextBox("post_title", "Post Title");
			$builder->addSelect("post_style", "Post Style", [
				"default" => esc_attr__("Default"),
				"grid" => esc_attr__("Grid"),
				"masonry" => esc_attr__("Masonry"),
			]);
		});
		$builder->addSection("Portfolio", "Header", function() use ($builder) {
			$builder->addTextBox("portfolio_title", "Portfolio Title");
			$builder->addSelect("portfolio_style", "Portfolio Style", [
				"default" => esc_attr__("Default"),
				"grid" => esc_attr__("Grid"),
				"masonry" => esc_attr__("Masonry"),
			]);
		});
	});
});

<h1><?= get_theme_mod('post_title')