<?php namespace ZeroWP\Customizer; zerowp_customizer_register_control('font', __NAMESPACE__ . '\\ControlFont'); add_action('customize_register', __NAMESPACE__ . '\\zerowp_customizer_register_control_font'); function zerowp_customizer_register_control_font($wp_customize) { class ControlFont extends \WP_Customize_Control { public $type = 'font'; public $args = array(); public $field_id; public function __construct($manager, $id, $args = array()) { $this->args = $args; $this->field_id = $id; parent::__construct($manager, $id, $args); } public function enqueue() { wp_register_style('zerowp-customizer-font-styles', plugin_dir_url(__FILE__) . 'assets/style.css'); wp_enqueue_style('zerowp-customizer-font-styles'); wp_register_script('zerowp-customizer-font-scripts', plugin_dir_url(__FILE__) . 'assets/scripts.js', 'jquery', false, true); wp_enqueue_script('zerowp-customizer-font-scripts'); parent::enqueue(); } public function render_content() { ?> <label>
<?php function zerowp_customizer_custom_controls() { return apply_filters('zerowp_customizer_custom_controls', array()); } function zerowp_customizer_register_control($type_name, $class_name) { $log_control = new ZeroWP\Customizer\Register($type_name, $class_name); $log_control->register(); } function zerowp_customizer_deregister_control($type_name) { $log_control = new ZeroWP\Customizer\Register($type_name); $log_control->deregister(); } /* ------------------------------------------------------------------------------- Register built-in controls ------------------------------------------------------------------------------- */ zerowp_customizer_register_control('color', 'WP_Customize_Color_Control'); zerowp_customizer_register_control('upload', 'WP_Customize_Upload_Control'); zerowp_customizer_register_control('image', 'WP_Customize_Image_Control'); zerowp_customizer_register_control('background', 'WP_Customize_Background_Image_Control');
<?php namespace ZeroWP\Customizer; zerowp_customizer_register_control('image_select', __NAMESPACE__ . '\\ImageSelect'); add_action('customize_register', __NAMESPACE__ . '\\zerowp_customizer_register_control_image_select'); function zerowp_customizer_register_control_image_select($wp_customize) { class ImageSelect extends \WP_Customize_Control { public $type = 'image_select'; public $args = array(); public function __construct($manager, $id, $args = array()) { $this->args = $args; parent::__construct($manager, $id, $args); } public function enqueue() { wp_register_style('zerowp-customizer-image-select-styles', plugin_dir_url(__FILE__) . 'assets/styles.css'); wp_enqueue_style('zerowp-customizer-image-select-styles'); wp_register_script('zerowp-customizer-image-select-scripts', plugin_dir_url(__FILE__) . 'assets/scripts.js', 'jquery', false, true); wp_enqueue_script('zerowp-customizer-image-select-scripts'); parent::enqueue(); } public function render_content() { ?> <div class="<?php echo $this->id; ?>
<?php namespace ZeroWP\Customizer; zerowp_customizer_register_control('info_text', __NAMESPACE__ . '\\InfoText'); add_action('customize_register', __NAMESPACE__ . '\\zerowp_customizer_register_control_info_text'); function zerowp_customizer_register_control_info_text($wp_customize) { class InfoText extends \WP_Customize_Control { public $type = 'info_text'; public $args = array(); public function __construct($manager, $id, $args = array()) { $this->args = $args; parent::__construct($manager, $id, $args); } public function render_content() { $output = ''; $output .= '<div class="info-text-customizer-control">'; if (!empty($this->label)) { $output .= '<h2>' . $this->label . '</h2>'; } if (!empty($this->description)) { $output .= '<div>' . $this->description . '</div><p></p>'; } $output .= '</div>'; echo $output; } }
<?php namespace ZeroWP\Customizer; zerowp_customizer_register_control('ui_slider', __NAMESPACE__ . '\\UiSlider'); add_action('customize_register', __NAMESPACE__ . '\\zerowp_customizer_register_control_ui_slider'); function zerowp_customizer_register_control_ui_slider($wp_customize) { class UiSlider extends \WP_Customize_Control { public $id; public $type = 'ui_slider'; public $args = array(); public function __construct($manager, $id, $args = array()) { $this->id = $id; $this->args = $args; parent::__construct($manager, $id, $args); } public function enqueue() { wp_register_style('zerowp-customizer-ui-slider-styles', plugin_dir_url(__FILE__) . 'assets/styles.css'); wp_enqueue_style('zerowp-customizer-ui-slider-styles'); wp_register_script('zerowp-customizer-ui-slider-scripts', plugin_dir_url(__FILE__) . 'assets/scripts.js', array('jquery', 'jquery-ui-core'), false, true); wp_enqueue_script('zerowp-customizer-ui-slider-scripts'); parent::enqueue(); } public function render_content() { ?> <div class="<?php
<?php namespace ZeroWP\Customizer; zerowp_customizer_register_control('button', __NAMESPACE__ . '\\ControlButton'); add_action('customize_register', __NAMESPACE__ . '\\zerowp_customizer_register_control_button'); function zerowp_customizer_register_control_button($wp_customize) { class ControlButton extends \WP_Customize_Control { public $type = 'button'; public $args = array(); public function __construct($manager, $id, $args = array()) { $this->args = $args; parent::__construct($manager, $id, $args); } public function render_content() { ?> <label> <span class="customize-control-title"><?php echo esc_html($this->label); ?> </span> <?php if (!empty($this->description)) { ?> <span class="description customize-control-description"><?php echo $this->description; ?>