registerActionHooks(); self::$inst = LEAPIN_Theme_Mod::get_instance(); return $this; } public function registerActionHooks() { add_action('customize_register', array($this, 'registerCustomizer')); add_action('customize_controls_enqueue_scripts', array($this, 'enqueue_control_scripts'), 0); return $this; } public function registerCustomizer($wp_customize) { $section = 'leapin_promotion_section'; // Register sections. $wp_customize->add_section( new LeapIn_With_Label_Section($wp_customize, 'leapin_promotion_section', array( 'title' => esc_html__('Pjax Blog Pro', 'pjax-blog'), 'label' => esc_html__('Learn Pro', 'pjax-blog'), 'priority' => 9999 ) ) ); $wp_customize->add_setting($setting_id = LEAPIN_IDs::$leapin_promotion, array( 'type' => 'theme_mod', // or 'option' 'sanitize_callback' => 'leapin_sanitize_mock', )); $wp_customize->add_control(new LEAPIN_Promotion_Customize_Control($wp_customize, LEAPIN_IDs::$leapin_promotion, array( 'settings' => LEAPIN_IDs::$leapin_promotion, 'section' => $section ))); return $this; } /** * Loads theme customizer CSS. * * @access public * @return void */ public function enqueue_control_scripts() { wp_enqueue_script('leapin-with-label-section', trailingslashit(get_template_directory_uri()) . 'inc/customizer/with-label-section/customize-controls.js', array('customize-controls')); } } new LEAPIN_Promotion();