register_control_type( 'Aces_Customizer_Color_Control'); $wp_customize->register_control_type( 'Aces_Customizer_Dimensions_Control'); $wp_customize->register_control_type( 'Aces_Customizer_Textarea_Control'); $wp_customize->register_control_type( 'Aces_Customizer_Heading_Control'); $wp_customize->register_control_type( 'Aces_Customizer_Buttonset_Control'); $wp_customize->register_control_type( 'Aces_Customizer_Range_Control' ); $wp_customize->register_control_type( 'Aces_Customizer_Text_Control'); $wp_customize->register_control_type( 'Aces_Customizer_Slider_Control'); $wp_customize->register_control_type( 'Aces_Customizer_Sortable_Control'); $wp_customize->register_control_type( 'Aces_Customizer_Boxedshadow_Control'); $wp_customize->register_control_type( 'Aces_Customizer_Radio_Image_Control'); } /** * Adds customizer helpers * * @since 1.0.0 */ public function controls_helpers() { require_once( ACES_THEME_DIR .'inc/customizer/customizer-helpers.php' ); require_once( ACES_THEME_DIR .'inc/customizer/sanitization-callbacks.php' ); } /** * Core modules * * @since 1.0.0 */ public static function customize_register( $wp_customize ) { // Tweak default controls $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; // Move custom logo setting $wp_customize->get_control( 'custom_logo' )->section = 'aces_header_logo'; $wp_customize->get_control( 'blogdescription' )->section = 'aces_header_logo'; $wp_customize->get_control( 'blogname' )->section = 'aces_header_logo'; $wp_customize->get_control( 'display_header_text' )->section = 'aces_header_logo'; $wp_customize->get_control( 'site_icon' )->section = 'aces_header_logo'; $wp_customize->get_control( 'background_color' )->section = 'aces_color_and_background_styling'; $wp_customize->get_control( 'background_image' )->section = 'aces_color_and_background_styling'; $wp_customize->get_control( 'background_preset' )->section = 'aces_color_and_background_styling'; $wp_customize->get_control( 'background_position' )->section = 'aces_color_and_background_styling'; $wp_customize->get_control( 'background_size' )->section = 'aces_color_and_background_styling'; $wp_customize->get_control( 'background_repeat' )->section = 'aces_color_and_background_styling'; $wp_customize->get_control( 'background_attachment' )->section = 'aces_color_and_background_styling'; $wp_customize->get_control( 'custom_logo' )->priority = 5; $wp_customize->get_control( 'blogname' )->priority = 7; $wp_customize->get_control( 'blogdescription' )->priority = 10; $wp_customize->get_control( 'header_textcolor' )->priority = 9; $wp_customize->get_control( 'site_icon' )->priority = 5; } /** * Adds customizer options * * @since 1.0.0 */ public function register_options() { // Var $dir = ACES_THEME_DIR .'/inc/customizer/settings/'; // Customizer files array $files = array( 'global', 'topbar', 'header', 'blog-and-pages', 'sidebar', 'footer', ); foreach ( $files as $key ) { require_once( $dir . $key .'.php' ); } } /** * Loads js file for customizer preview * * @since 1.0.0 */ public function customize_preview_init() { wp_enqueue_script( 'aces-customize-preview', ACES_THEME_URI .'inc/customizer/assets/js/customize-preview.min.js', array( 'customize-preview' ), '1.0', true ); } /** * Load scripts for customizer * * @since 1.0.0 */ public function custom_customize_enqueue() { wp_enqueue_style( 'font-awesome', ACES_THEME_URI .'/assets/css/all.min.css', false, '5.11.2' ); wp_enqueue_style( 'simple-line-icons', ACES_THEME_URI .'inc/customizer/assets/css/customizer-simple-line-icons.min.css', false, '2.4.0' ); wp_enqueue_style( 'aces-general', ACES_THEME_URI .'inc/customizer/assets/css/general.css' ); wp_enqueue_script( 'aces-general', ACES_THEME_URI .'inc/customizer/assets/js/general.min.js', array( 'jquery', 'customize-base' ), false, true ); } } endif; return new Aces_Customizer();