registerActionHooks(); } public function registerActionHooks() { add_action('customize_register', array($this, 'registerCustomCustomizer'), 1); add_action('customize_preview_init', array($this, 'preview')); } public function registerCustomCustomizer($wp_customize) { if (class_exists('WP_Customize_Control')) { require_once(trailingslashit(get_template_directory()) . 'inc/customizer/custom-control/heading-customize-control.php'); require_once(trailingslashit(get_template_directory()) . 'inc/customizer/custom-control/heading-larger-customize-control.php'); require_once(trailingslashit(get_template_directory()) . 'inc/customizer/custom-control/promotion-customize-control.php'); // require_once(trailingslashit(get_template_directory()) . 'inc/customizer/custom-control/upgrade-customize-control.php'); require_once(trailingslashit(get_template_directory()) . 'inc/customizer/alpha-color-picker/alpha-color-picker.php'); } if (class_exists('WP_Customize_Section')) { // Register custom section types. require_once(trailingslashit(get_template_directory()) . 'inc/customizer/with-label-section/section.php'); $wp_customize->register_section_type('LeapIn_With_Label_Section'); } } public function preview() { wp_enqueue_script( 'leapin_css_preview', get_template_directory_uri() . '/inc/customizer/customizer.js.php', array('customize-preview', 'jquery') ); return $this; } } new LEAPIN_Customizer();