register_section_type( Architect_Engineer_Button::class ); $manager->add_section( new Architect_Engineer_Button( $manager, 'architect_engineer_pro', [ 'title' => __( 'Architect Engineer Pro', 'architect-engineer' ), 'priority' => 0, 'button_text' => __( 'GET PREMIUM', 'architect-engineer' ), 'button_url' => esc_url( 'https://www.themagnifico.net/products/engineer-wordpress-theme', 'architect-engineer') ] ) ); } ); // Load the JS and CSS. add_action( 'customize_controls_enqueue_scripts', function() { $version = wp_get_theme()->get( 'Version' ); wp_enqueue_script( 'architect-engineer-customize-section-button', get_theme_file_uri( 'vendor/wptrt/customize-section-button/public/js/customize-controls.js' ), [ 'customize-controls' ], $version, true ); wp_enqueue_style( 'architect-engineer-customize-section-button', get_theme_file_uri( 'vendor/wptrt/customize-section-button/public/css/customize-controls.css' ), [ 'customize-controls' ], $version ); } ); /** * Add postMessage support for site title and description for the Theme Customizer. * * @param WP_Customize_Manager $wp_customize Theme Customizer object. */ function architect_engineer_customize_register($wp_customize){ // Pro Version class Architect_Engineer_Customize_Pro_Version extends WP_Customize_Control { public $type = 'pro_options'; public function render_content() { echo 'For More '. esc_html( $this->label ) .'?'; echo ''; echo ''; echo ' '. esc_html( ARCHITECT_ENGINNER_BUY_TEXT,'architect-engineer' ) .''; echo ''; } } // Custom Controls function Architect_Engineer_sanitize_custom_control( $input ) { return $input; } $wp_customize->get_setting('blogname')->transport = 'postMessage'; $wp_customize->get_setting('blogdescription')->transport = 'postMessage'; //Logo $wp_customize->add_setting('architect_engineer_logo_max_height',array( 'default' => '24', 'sanitize_callback' => 'architect_engineer_sanitize_number_absint' )); $wp_customize->add_control('architect_engineer_logo_max_height',array( 'label' => esc_html__('Logo Width','architect-engineer'), 'section' => 'title_tagline', 'type' => 'number' )); $wp_customize->add_setting('architect_engineer_logo_title_text', array( 'default' => true, 'sanitize_callback' => 'architect_engineer_sanitize_checkbox' )); $wp_customize->add_control( new WP_Customize_Control($wp_customize,'architect_engineer_logo_title_text',array( 'label' => __( 'Enable Disable Title', 'architect-engineer' ), 'section' => 'title_tagline', 'settings' => 'architect_engineer_logo_title_text', 'type' => 'checkbox', ))); $wp_customize->add_setting('architect_engineer_theme_description', array( 'default' => false, 'sanitize_callback' => 'architect_engineer_sanitize_checkbox' )); $wp_customize->add_control( new WP_Customize_Control($wp_customize,'architect_engineer_theme_description',array( 'label' => __( 'Enable Disable Tagline', 'architect-engineer' ), 'section' => 'title_tagline', 'settings' => 'architect_engineer_theme_description', 'type' => 'checkbox', ))); $wp_customize->add_setting('architect_engineer_logo_title_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color', )); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'architect_engineer_logo_title_color', array( 'label' => __('Site Title Color', 'architect-engineer'), 'section' => 'title_tagline' ))); $wp_customize->add_setting('architect_engineer_logo_tagline_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color', )); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'architect_engineer_logo_tagline_color', array( 'label' => __('Site Tagline Color', 'architect-engineer'), 'section' => 'title_tagline' ))); // Pro Version $wp_customize->add_setting( 'pro_version_logo', array( 'sanitize_callback' => 'Architect_Engineer_sanitize_custom_control' )); $wp_customize->add_control( new Architect_Engineer_Customize_Pro_Version ( $wp_customize,'pro_version_logo', array( 'section' => 'title_tagline', 'type' => 'pro_options', 'label' => esc_html__( 'Customizer Options', 'architect-engineer' ), 'description' => esc_url( ARCHITECT_ENGINNER_URL ), 'priority' => 100 ))); // Global Color Settings $wp_customize->add_section('architect_engineer_global_color_settings',array( 'title' => esc_html__('Global Settings','architect-engineer'), 'priority' => 28, )); $wp_customize->add_setting( 'architect_engineer_global_color', array( 'default' => '#d39e66', 'sanitize_callback' => 'sanitize_hex_color' )); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'architect_engineer_global_color', array( 'description' => __('Change the global color of the theme in one click.', 'architect-engineer'), 'section' => 'architect_engineer_global_color_settings', 'settings' => 'architect_engineer_global_color', ))); //Typography option $architect_engineer_font_array = array( '' => 'No Fonts', 'Abril Fatface' => 'Abril Fatface', 'Acme' => 'Acme', 'Anton' => 'Anton', 'Architects Daughter' => 'Architects Daughter', 'Arimo' => 'Arimo', 'Arsenal' => 'Arsenal', 'Arvo' => 'Arvo', 'Alegreya' => 'Alegreya', 'Alfa Slab One' => 'Alfa Slab One', 'Averia Serif Libre' => 'Averia Serif Libre', 'Bangers' => 'Bangers', 'Boogaloo' => 'Boogaloo', 'Bad Script' => 'Bad Script', 'Bitter' => 'Bitter', 'Bree Serif' => 'Bree Serif', 'BenchNine' => 'BenchNine', 'Cabin' => 'Cabin', 'Cardo' => 'Cardo', 'Courgette' => 'Courgette', 'Cherry Swash' => 'Cherry Swash', 'Cormorant Garamond' => 'Cormorant Garamond', 'Crimson Text' => 'Crimson Text', 'Cuprum' => 'Cuprum', 'Cookie' => 'Cookie', 'Chewy' => 'Chewy', 'Days One' => 'Days One', 'Dosis' => 'Dosis', 'Droid Sans' => 'Droid Sans', 'Economica' => 'Economica', 'Fredoka One' => 'Fredoka One', 'Fjalla One' => 'Fjalla One', 'Francois One' => 'Francois One', 'Frank Ruhl Libre' => 'Frank Ruhl Libre', 'Gloria Hallelujah' => 'Gloria Hallelujah', 'Great Vibes' => 'Great Vibes', 'Handlee' => 'Handlee', 'Hammersmith One' => 'Hammersmith One', 'Inconsolata' => 'Inconsolata', 'Indie Flower' => 'Indie Flower', 'IM Fell English SC' => 'IM Fell English SC', 'Julius Sans One' => 'Julius Sans One', 'Josefin Slab' => 'Josefin Slab', 'Josefin Sans' => 'Josefin Sans', 'Kanit' => 'Kanit', 'Lobster' => 'Lobster', 'Lato' => 'Lato', 'Lora' => 'Lora', 'Libre Baskerville' => 'Libre Baskerville', 'Lobster Two' => 'Lobster Two', 'Merriweather' => 'Merriweather', 'Monda' => 'Monda', 'Montserrat' => 'Montserrat', 'Muli' => 'Muli', 'Marck Script' => 'Marck Script', 'Noto Serif' => 'Noto Serif', 'Open Sans' => 'Open Sans', 'Overpass' => 'Overpass', 'Overpass Mono' => 'Overpass Mono', 'Oxygen' => 'Oxygen', 'Orbitron' => 'Orbitron', 'Patua One' => 'Patua One', 'Pacifico' => 'Pacifico', 'Padauk' => 'Padauk', 'Playball' => 'Playball', 'Playfair Display' => 'Playfair Display', 'PT Sans' => 'PT Sans', 'Philosopher' => 'Philosopher', 'Permanent Marker' => 'Permanent Marker', 'Poiret One' => 'Poiret One', 'Quicksand' => 'Quicksand', 'Quattrocento Sans' => 'Quattrocento Sans', 'Raleway' => 'Raleway', 'Rubik' => 'Rubik', 'Roboto' => 'Roboto', 'Rokkitt' => 'Rokkitt', 'Russo One' => 'Russo One', 'Righteous' => 'Righteous', 'Slabo' => 'Slabo', 'Source Sans Pro' => 'Source Sans Pro', 'Shadows Into Light Two' => 'Shadows Into Light Two', 'Shadows Into Light' => 'Shadows Into Light', 'Sacramento' => 'Sacramento', 'Shrikhand' => 'Shrikhand', 'Tangerine' => 'Tangerine', 'Ubuntu' => 'Ubuntu', 'VT323' => 'VT323', 'Varela Round' => 'Varela Round', 'Vampiro One' => 'Vampiro One', 'Vollkorn' => 'Vollkorn', 'Volkhov' => 'Volkhov', 'Yanone Kaffeesatz' => 'Yanone Kaffeesatz' ); // Heading Typography $wp_customize->add_setting( 'architect_engineer_heading_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color' )); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'architect_engineer_heading_color', array( 'label' => __('Heading Color', 'architect-engineer'), 'section' => 'architect_engineer_global_color_settings', 'settings' => 'architect_engineer_heading_color', ))); $wp_customize->add_setting('architect_engineer_heading_font_family', array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'architect_engineer_sanitize_choices', )); $wp_customize->add_control( 'architect_engineer_heading_font_family', array( 'section' => 'architect_engineer_global_color_settings', 'label' => __('Heading Fonts', 'architect-engineer'), 'type' => 'select', 'choices' => $architect_engineer_font_array, )); $wp_customize->add_setting('architect_engineer_heading_font_size',array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('architect_engineer_heading_font_size',array( 'label' => esc_html__('Heading Font Size','architect-engineer'), 'section' => 'architect_engineer_global_color_settings', 'setting' => 'architect_engineer_heading_font_size', 'type' => 'text' )); // Paragraph Typography $wp_customize->add_setting( 'architect_engineer_paragraph_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color' )); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'architect_engineer_paragraph_color', array( 'label' => __('Paragraph Color', 'architect-engineer'), 'section' => 'architect_engineer_global_color_settings', 'settings' => 'architect_engineer_paragraph_color', ))); $wp_customize->add_setting('architect_engineer_paragraph_font_family', array( 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'architect_engineer_sanitize_choices', )); $wp_customize->add_control( 'architect_engineer_paragraph_font_family', array( 'section' => 'architect_engineer_global_color_settings', 'label' => __('Paragraph Fonts', 'architect-engineer'), 'type' => 'select', 'choices' => $architect_engineer_font_array, )); $wp_customize->add_setting('architect_engineer_paragraph_font_size',array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('architect_engineer_paragraph_font_size',array( 'label' => esc_html__('Paragraph Font Size','architect-engineer'), 'section' => 'architect_engineer_global_color_settings', 'setting' => 'architect_engineer_paragraph_font_size', 'type' => 'text' )); // General Settings $wp_customize->add_section('architect_engineer_general_settings',array( 'title' => esc_html__('General Settings','architect-engineer'), 'priority' => 30, )); $wp_customize->add_setting('architect_engineer_preloader_hide', array( 'default' => false, 'sanitize_callback' => 'architect_engineer_sanitize_checkbox' )); $wp_customize->add_control( new WP_Customize_Control($wp_customize,'architect_engineer_preloader_hide',array( 'label' => __( 'Show Theme Preloader', 'architect-engineer' ), 'section' => 'architect_engineer_general_settings', 'settings' => 'architect_engineer_preloader_hide', 'type' => 'checkbox', ))); $wp_customize->add_setting( 'architect_engineer_preloader_bg_color', array( 'default' => '#fff', 'sanitize_callback' => 'sanitize_hex_color' )); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'architect_engineer_preloader_bg_color', array( 'label' => esc_html__('Preloader Background Color','architect-engineer'), 'section' => 'architect_engineer_general_settings', 'settings' => 'architect_engineer_preloader_bg_color' ))); $wp_customize->add_setting( 'architect_engineer_preloader_dot_1_color', array( 'default' => '#000', 'sanitize_callback' => 'sanitize_hex_color' )); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'architect_engineer_preloader_dot_1_color', array( 'label' => esc_html__('Preloader First Dot Color','architect-engineer'), 'section' => 'architect_engineer_general_settings', 'settings' => 'architect_engineer_preloader_dot_1_color' ))); $wp_customize->add_setting( 'architect_engineer_preloader_dot_2_color', array( 'default' => '#d39d65', 'sanitize_callback' => 'sanitize_hex_color' )); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'architect_engineer_preloader_dot_2_color', array( 'label' => esc_html__('Preloader Second Dot Color','architect-engineer'), 'section' => 'architect_engineer_general_settings', 'settings' => 'architect_engineer_preloader_dot_2_color' ))); $wp_customize->add_setting('architect_engineer_scroll_hide', array( 'default' => false, 'sanitize_callback' => 'architect_engineer_sanitize_checkbox' )); $wp_customize->add_control( new WP_Customize_Control($wp_customize,'architect_engineer_scroll_hide',array( 'label' => __( 'Show Theme Scroll To Top', 'architect-engineer' ), 'section' => 'architect_engineer_general_settings', 'settings' => 'architect_engineer_scroll_hide', 'type' => 'checkbox', ))); $wp_customize->add_setting('architect_engineer_scroll_top_position',array( 'default' => 'Right', 'sanitize_callback' => 'architect_engineer_sanitize_choices' )); $wp_customize->add_control('architect_engineer_scroll_top_position',array( 'label' => esc_html__( 'Scroll To Top Positions','architect-engineer' ), 'type' => 'radio', 'section' => 'architect_engineer_general_settings', 'choices' => array( 'Right' => __('Right','architect-engineer'), 'Left' => __('Left','architect-engineer'), 'Center' => __('Center','architect-engineer') ), ) ); $wp_customize->add_setting( 'architect_engineer_scroll_to_top_border_radius', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'architect_engineer_sanitize_number_range' ) ); $wp_customize->add_control( 'architect_engineer_scroll_to_top_border_radius', array( 'label' => esc_html__( 'Scroll To Top Border Radius','architect-engineer' ), 'section' => 'architect_engineer_general_settings', 'type' => 'range', 'input_attrs' => array( 'step' => 1, 'min' => 1, 'max' => 50, ), ) ); $wp_customize->add_setting('architect_engineer_sticky_header', array( 'default' => false, 'sanitize_callback' => 'architect_engineer_sanitize_checkbox' )); $wp_customize->add_control( new WP_Customize_Control($wp_customize,'architect_engineer_sticky_header',array( 'label' => __( 'Show Sticky Header', 'architect-engineer' ), 'section' => 'architect_engineer_general_settings', 'settings' => 'architect_engineer_sticky_header', 'type' => 'checkbox', ))); // Product Columns $wp_customize->add_setting( 'architect_engineer_products_per_row' , array( 'default' => '3', 'transport' => 'refresh', 'sanitize_callback' => 'architect_engineer_sanitize_select', ) ); $wp_customize->add_control('architect_engineer_products_per_row', array( 'label' => __( 'Product per row', 'architect-engineer' ), 'section' => 'architect_engineer_general_settings', 'type' => 'select', 'choices' => array( '2' => '2', '3' => '3', '4' => '4', ), ) ); $wp_customize->add_setting('architect_engineer_product_per_page',array( 'default' => '9', 'sanitize_callback' => 'architect_engineer_sanitize_float' )); $wp_customize->add_control('architect_engineer_product_per_page',array( 'label' => __('Product per page','architect-engineer'), 'section' => 'architect_engineer_general_settings', 'type' => 'number' )); //Woocommerce shop page Sidebar $wp_customize->add_setting('architect_engineer_woocommerce_shop_page_sidebar', array( 'default' => true, 'sanitize_callback' => 'architect_engineer_sanitize_checkbox' )); $wp_customize->add_control( new WP_Customize_Control($wp_customize,'architect_engineer_woocommerce_shop_page_sidebar',array( 'label' => __( 'Hide Shop Page Sidebar', 'architect-engineer' ), 'section' => 'architect_engineer_general_settings', 'settings' => 'architect_engineer_woocommerce_shop_page_sidebar', 'type' => 'checkbox', ))); $wp_customize->add_setting('architect_engineer_shop_page_sidebar_layout',array( 'default' => 'Right Sidebar', 'sanitize_callback' => 'architect_engineer_sanitize_choices' )); $wp_customize->add_control('architect_engineer_shop_page_sidebar_layout',array( 'type' => 'select', 'label' => __('Woocommerce Shop Page Sidebar','architect-engineer'), 'section' => 'architect_engineer_general_settings', 'choices' => array( 'Left Sidebar' => __('Left Sidebar','architect-engineer'), 'Right Sidebar' => __('Right Sidebar','architect-engineer'), ), ) ); //Woocommerce Single Product page Sidebar $wp_customize->add_setting('architect_engineer_woocommerce_single_product_page_sidebar', array( 'default' => true, 'sanitize_callback' => 'architect_engineer_sanitize_checkbox' )); $wp_customize->add_control( new WP_Customize_Control($wp_customize,'architect_engineer_woocommerce_single_product_page_sidebar',array( 'label' => __( 'Hide Single Product Page Sidebar', 'architect-engineer' ), 'section' => 'architect_engineer_general_settings', 'settings' => 'architect_engineer_woocommerce_single_product_page_sidebar', 'type' => 'checkbox', ))); $wp_customize->add_setting('architect_engineer_single_product_sidebar_layout',array( 'default' => 'Right Sidebar', 'sanitize_callback' => 'architect_engineer_sanitize_choices' )); $wp_customize->add_control('architect_engineer_single_product_sidebar_layout',array( 'type' => 'select', 'label' => __('Woocommerce Single Product Page Sidebar','architect-engineer'), 'section' => 'architect_engineer_general_settings', 'choices' => array( 'Left Sidebar' => __('Left Sidebar','architect-engineer'), 'Right Sidebar' => __('Right Sidebar','architect-engineer'), ), ) ); $wp_customize->add_setting('architect_engineer_woocommerce_product_sale',array( 'default' => 'Left', 'sanitize_callback' => 'architect_engineer_sanitize_choices' )); $wp_customize->add_control('architect_engineer_woocommerce_product_sale',array( 'label' => esc_html__( 'Woocommerce Product Sale Positions','architect-engineer' ), 'type' => 'radio', 'section' => 'architect_engineer_general_settings', 'choices' => array( 'Right' => __('Right','architect-engineer'), 'Left' => __('Left','architect-engineer'), 'Center' => __('Center','architect-engineer') ), ) ); $wp_customize->add_setting( 'architect_engineer_woo_product_sale_border_radius', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'architect_engineer_sanitize_number_range' ) ); $wp_customize->add_control( 'architect_engineer_woo_product_sale_border_radius', array( 'label' => esc_html__( 'Woocommerce Product Sale Border Radius','architect-engineer' ), 'section' => 'architect_engineer_general_settings', 'type' => 'range', 'input_attrs' => array( 'step' => 1, 'min' => 1, 'max' => 50, ), ) ); // Related Product $wp_customize->add_setting('architect_engineer_woocommerce_related_product_show_hide', array( 'default' => true, 'sanitize_callback' => 'architect_engineer_sanitize_checkbox' )); $wp_customize->add_control( new WP_Customize_Control($wp_customize,'architect_engineer_woocommerce_related_product_show_hide',array( 'label' => __( 'Show / Hide Related product', 'architect-engineer' ), 'section' => 'architect_engineer_general_settings', 'settings' => 'architect_engineer_woocommerce_related_product_show_hide', 'type' => 'checkbox', ))); // Pro Version $wp_customize->add_setting( 'pro_version_general_setting', array( 'sanitize_callback' => 'Architect_Engineer_sanitize_custom_control' )); $wp_customize->add_control( new Architect_Engineer_Customize_Pro_Version ( $wp_customize,'pro_version_general_setting', array( 'section' => 'architect_engineer_general_settings', 'type' => 'pro_options', 'label' => esc_html__( 'Customizer Options', 'architect-engineer' ), 'description' => esc_url( ARCHITECT_ENGINNER_URL ), 'priority' => 100 ))); // Post Settings $wp_customize->add_section('architect_engineer_post_settings',array( 'title' => esc_html__('Post Settings','architect-engineer'), 'priority' =>40, )); $wp_customize->add_setting('architect_engineer_post_page_title',array( 'sanitize_callback' => 'architect_engineer_sanitize_checkbox', 'default' => 1, )); $wp_customize->add_control('architect_engineer_post_page_title',array( 'type' => 'checkbox', 'label' => esc_html__('Enable Post Page Title', 'architect-engineer'), 'section' => 'architect_engineer_post_settings', 'description' => esc_html__('Check this box to enable title on post page.', 'architect-engineer'), )); $wp_customize->add_setting('architect_engineer_post_page_meta',array( 'sanitize_callback' => 'architect_engineer_sanitize_checkbox', 'default' => 1, )); $wp_customize->add_control('architect_engineer_post_page_meta',array( 'type' => 'checkbox', 'label' => esc_html__('Enable Post Page Meta', 'architect-engineer'), 'section' => 'architect_engineer_post_settings', 'description' => esc_html__('Check this box to enable meta on post page.', 'architect-engineer'), )); $wp_customize->add_setting('architect_engineer_post_page_thumb',array( 'sanitize_callback' => 'architect_engineer_sanitize_checkbox', 'default' => 1, )); $wp_customize->add_control('architect_engineer_post_page_thumb',array( 'type' => 'checkbox', 'label' => esc_html__('Enable Post Page Thumbnail', 'architect-engineer'), 'section' => 'architect_engineer_post_settings', 'description' => esc_html__('Check this box to enable thumbnail on post page.', 'architect-engineer'), )); $wp_customize->add_setting( 'architect_engineer_post_page_image_border_radius', array( 'default' => '0', 'transport' => 'refresh', 'sanitize_callback' => 'architect_engineer_sanitize_number_range' ) ); $wp_customize->add_control( 'architect_engineer_post_page_image_border_radius', array( 'label' => esc_html__( 'Post Page Image Border Radius','architect-engineer' ), 'section' => 'architect_engineer_post_settings', 'type' => 'range', 'input_attrs' => array( 'step' => 1, 'min' => 1, 'max' => 50, ), ) ); $wp_customize->add_setting('architect_engineer_post_page_btn',array( 'sanitize_callback' => 'architect_engineer_sanitize_checkbox', 'default' => 1, )); $wp_customize->add_control('architect_engineer_post_page_btn',array( 'type' => 'checkbox', 'label' => esc_html__('Enable Post Page Button', 'architect-engineer'), 'section' => 'architect_engineer_post_settings', 'description' => esc_html__('Check this box to enable button on post page.', 'architect-engineer'), )); $wp_customize->add_setting('architect_engineer_post_page_content',array( 'sanitize_callback' => 'architect_engineer_sanitize_checkbox', 'default' => 1, )); $wp_customize->add_control('architect_engineer_post_page_content',array( 'type' => 'checkbox', 'label' => esc_html__('Enable Post Page Content', 'architect-engineer'), 'section' => 'architect_engineer_post_settings', 'description' => esc_html__('Check this box to enable content on post page.', 'architect-engineer'), )); $wp_customize->add_setting('architect_engineer_single_post_thumb',array( 'sanitize_callback' => 'architect_engineer_sanitize_checkbox', 'default' => 1, )); $wp_customize->add_control('architect_engineer_single_post_thumb',array( 'type' => 'checkbox', 'label' => esc_html__('Enable Single Post Thumbnail', 'architect-engineer'), 'section' => 'architect_engineer_post_settings', 'description' => esc_html__('Check this box to enable post thumbnail on single post.', 'architect-engineer'), )); $wp_customize->add_setting( 'architect_engineer_single_post_page_image_border_radius', array( 'default' => '0', 'transport' => 'refresh', 'sanitize_callback' => 'architect_engineer_sanitize_number_range' ) ); $wp_customize->add_control( 'architect_engineer_single_post_page_image_border_radius', array( 'label' => esc_html__( 'Single Post Page Image Border Radius','architect-engineer' ), 'section' => 'architect_engineer_post_settings', 'type' => 'range', 'input_attrs' => array( 'step' => 1, 'min' => 1, 'max' => 50, ), ) ); $wp_customize->add_setting( 'architect_engineer_single_post_page_image_box_shadow', array( 'default' => '0', 'transport' => 'refresh', 'sanitize_callback' => 'architect_engineer_sanitize_number_range' ) ); $wp_customize->add_control( 'architect_engineer_single_post_page_image_box_shadow', array( 'label' => esc_html__( 'Single Post Page Image Box Shadow','architect-engineer' ), 'section' => 'architect_engineer_post_settings', 'type' => 'range', 'input_attrs' => array( 'step' => 1, 'min' => 1, 'max' => 50, ), ) ); $wp_customize->add_setting('architect_engineer_single_post_meta',array( 'sanitize_callback' => 'architect_engineer_sanitize_checkbox', 'default' => 1, )); $wp_customize->add_control('architect_engineer_single_post_meta',array( 'type' => 'checkbox', 'label' => esc_html__('Enable Single Post Meta', 'architect-engineer'), 'section' => 'architect_engineer_post_settings', 'description' => esc_html__('Check this box to enable single post meta such as post date, author, category, comment etc.', 'architect-engineer'), )); $wp_customize->add_setting('architect_engineer_single_post_title',array( 'sanitize_callback' => 'architect_engineer_sanitize_checkbox', 'default' => 1, )); $wp_customize->add_control('architect_engineer_single_post_title',array( 'type' => 'checkbox', 'label' => esc_html__('Enable Single Post Title', 'architect-engineer'), 'section' => 'architect_engineer_post_settings', 'description' => esc_html__('Check this box to enable title on single post.', 'architect-engineer'), )); $wp_customize->add_setting('architect_engineer_single_post_page_content',array( 'sanitize_callback' => 'architect_engineer_sanitize_checkbox', 'default' => 1, )); $wp_customize->add_control('architect_engineer_single_post_page_content',array( 'type' => 'checkbox', 'label' => esc_html__('Enable Single Post Page Content', 'architect-engineer'), 'section' => 'architect_engineer_post_settings', 'description' => esc_html__('Check this box to enable content on single post page.', 'architect-engineer'), )); $wp_customize->add_setting('architect_engineer_single_post_tags',array( 'sanitize_callback' => 'architect_engineer_sanitize_checkbox', 'default' => 1, )); $wp_customize->add_control('architect_engineer_single_post_tags',array( 'type' => 'checkbox', 'label' => esc_html__('Enable Single Post Tags', 'architect-engineer'), 'section' => 'architect_engineer_post_settings', 'description' => esc_html__('Check this box to enable tags on single post.', 'architect-engineer'), )); $wp_customize->add_setting('architect_engineer_single_post_navigation_show_hide',array( 'default' => true, 'sanitize_callback' => 'architect_engineer_sanitize_checkbox' )); $wp_customize->add_control('architect_engineer_single_post_navigation_show_hide',array( 'type' => 'checkbox', 'label' => __('Show / Hide Post Navigation','architect-engineer'), 'section' => 'architect_engineer_post_settings', )); $wp_customize->add_setting('architect_engineer_single_post_comment_title',array( 'default'=> 'Leave a Reply', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('architect_engineer_single_post_comment_title',array( 'label' => __('Add Comment Title','architect-engineer'), 'input_attrs' => array( 'placeholder' => __( 'Leave a Reply', 'architect-engineer' ), ), 'section'=> 'architect_engineer_post_settings', 'type'=> 'text' )); $wp_customize->add_setting('architect_engineer_single_post_comment_btn_text',array( 'default'=> 'Post Comment', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('architect_engineer_single_post_comment_btn_text',array( 'label' => __('Add Comment Button Text','architect-engineer'), 'input_attrs' => array( 'placeholder' => __( 'Post Comment', 'architect-engineer' ), ), 'section'=> 'architect_engineer_post_settings', 'type'=> 'text' )); // Pro Version $wp_customize->add_setting( 'pro_version_post_setting', array( 'sanitize_callback' => 'Architect_Engineer_sanitize_custom_control' )); $wp_customize->add_control( new Architect_Engineer_Customize_Pro_Version ( $wp_customize,'pro_version_post_setting', array( 'section' => 'architect_engineer_post_settings', 'type' => 'pro_options', 'label' => esc_html__( 'Customizer Options', 'architect-engineer' ), 'description' => esc_url( ARCHITECT_ENGINNER_URL ), 'priority' => 100 ))); // Page Settings $wp_customize->add_section('architect_engineer_page_settings',array( 'title' => esc_html__('Page Settings','architect-engineer'), 'priority' =>50, )); $wp_customize->add_setting('architect_engineer_single_page_title',array( 'sanitize_callback' => 'architect_engineer_sanitize_checkbox', 'default' => 1, )); $wp_customize->add_control('architect_engineer_single_page_title',array( 'type' => 'checkbox', 'label' => esc_html__('Enable Single Page Title', 'architect-engineer'), 'section' => 'architect_engineer_page_settings', 'description' => esc_html__('Check this box to enable title on single page.', 'architect-engineer'), )); $wp_customize->add_setting('architect_engineer_single_page_thumb',array( 'sanitize_callback' => 'architect_engineer_sanitize_checkbox', 'default' => 1, )); $wp_customize->add_control('architect_engineer_single_page_thumb',array( 'type' => 'checkbox', 'label' => esc_html__('Enable Single Page Thumbnail', 'architect-engineer'), 'section' => 'architect_engineer_page_settings', 'description' => esc_html__('Check this box to enable page thumbnail on single page.', 'architect-engineer'), )); // Pro Version $wp_customize->add_setting( 'pro_version_single_page_setting', array( 'sanitize_callback' => 'Architect_Engineer_sanitize_custom_control' )); $wp_customize->add_control( new Architect_Engineer_Customize_Pro_Version ( $wp_customize,'pro_version_single_page_setting', array( 'section' => 'architect_engineer_page_settings', 'type' => 'pro_options', 'label' => esc_html__( 'Customizer Options', 'architect-engineer' ), 'description' => esc_url( ARCHITECT_ENGINNER_URL ), 'priority' => 100 ))); //Header $wp_customize->add_section('architect_engineer_header',array( 'title' => esc_html__('Header Option','architect-engineer') )); $wp_customize->add_setting('architect_engineer_phone_number',array( 'default' => '', 'sanitize_callback' => 'architect_engineer_sanitize_phone_number' )); $wp_customize->add_control('architect_engineer_phone_number',array( 'label' => esc_html__('Phone Number','architect-engineer'), 'section' => 'architect_engineer_header', 'setting' => 'architect_engineer_phone_number', 'type' => 'text' )); // Pro Version $wp_customize->add_setting( 'pro_version_header_setting', array( 'sanitize_callback' => 'Architect_Engineer_sanitize_custom_control' )); $wp_customize->add_control( new Architect_Engineer_Customize_Pro_Version ( $wp_customize,'pro_version_header_setting', array( 'section' => 'architect_engineer_header', 'type' => 'pro_options', 'label' => esc_html__( 'Customizer Options', 'architect-engineer' ), 'description' => esc_url( ARCHITECT_ENGINNER_URL ), 'priority' => 100 ))); //Slider $wp_customize->add_section('architect_engineer_top_slider',array( 'title' => esc_html__('Slider Option','architect-engineer') )); for ( $architect_engineer_count = 1; $architect_engineer_count <= 3; $architect_engineer_count++ ) { $wp_customize->add_setting( 'architect_engineer_top_slider_page' . $architect_engineer_count, array( 'default' => '', 'sanitize_callback' => 'architect_engineer_sanitize_dropdown_pages' ) ); $wp_customize->add_control( 'architect_engineer_top_slider_page' . $architect_engineer_count, array( 'label' => __( 'Select Slide Page', 'architect-engineer' ), 'description' => __('Slider image size (800 x 500)','architect-engineer'), 'section' => 'architect_engineer_top_slider', 'type' => 'dropdown-pages' ) ); } $wp_customize->add_setting('architect_engineer_slider_loop', array( 'default' => 1, 'sanitize_callback' => 'architect_engineer_sanitize_checkbox' )); $wp_customize->add_control( new WP_Customize_Control($wp_customize,'architect_engineer_slider_loop',array( 'label' => __( 'Enable Disable Slider Loop', 'architect-engineer' ), 'section' => 'architect_engineer_top_slider', 'settings' => 'architect_engineer_slider_loop', 'type' => 'checkbox', ))); //Slider Image Opacity $wp_customize->add_setting('architect_engineer_slider_opacity_color',array( 'default' => '', 'sanitize_callback' => 'architect_engineer_sanitize_choices' )); $wp_customize->add_control( 'architect_engineer_slider_opacity_color', array( 'label' => esc_html__( 'Slider Image Opacity','architect-engineer' ), 'section' => 'architect_engineer_top_slider', 'type' => 'select', 'choices' => array( '0' => esc_attr('0','architect-engineer'), '0.1' => esc_attr('0.1','architect-engineer'), '0.2' => esc_attr('0.2','architect-engineer'), '0.3' => esc_attr('0.3','architect-engineer'), '0.4' => esc_attr('0.4','architect-engineer'), '0.5' => esc_attr('0.5','architect-engineer'), '0.6' => esc_attr('0.6','architect-engineer'), '0.7' => esc_attr('0.7','architect-engineer'), '0.8' => esc_attr('0.8','architect-engineer'), '0.9' => esc_attr('0.9','architect-engineer') ), )); //Slider height $wp_customize->add_setting('architect_engineer_slider_img_height',array( 'default'=> '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('architect_engineer_slider_img_height',array( 'label' => __('Slider Height','architect-engineer'), 'description' => __('Add the slider height in px(eg. 500px).','architect-engineer'), 'input_attrs' => array( 'placeholder' => __( '500px', 'architect-engineer' ), ), 'section'=> 'architect_engineer_top_slider', 'type'=> 'text' )); // Pro Version $wp_customize->add_setting( 'pro_version_slider_setting', array( 'sanitize_callback' => 'Architect_Engineer_sanitize_custom_control' )); $wp_customize->add_control( new Architect_Engineer_Customize_Pro_Version ( $wp_customize,'pro_version_slider_setting', array( 'section' => 'architect_engineer_top_slider', 'type' => 'pro_options', 'label' => esc_html__( 'Customizer Options', 'architect-engineer' ), 'description' => esc_url( ARCHITECT_ENGINNER_URL ), 'priority' => 100 ))); //Latest Project $wp_customize->add_section('architect_engineer_new_project',array( 'title' => esc_html__('Latest Projects','architect-engineer'), 'description' => esc_html__('Here you have to select project which will display perticular latest project in the home page.','architect-engineer') )); $wp_customize->add_setting('architect_engineer_projects_short_title',array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('architect_engineer_projects_short_title',array( 'label' => esc_html__('Short Title','architect-engineer'), 'section' => 'architect_engineer_new_project', 'setting' => 'architect_engineer_projects_short_title', 'type' => 'text' )); $wp_customize->add_setting('architect_engineer_projects_title',array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field' )); $wp_customize->add_control('architect_engineer_projects_title',array( 'label' => esc_html__('Text','architect-engineer'), 'section' => 'architect_engineer_new_project', 'setting' => 'architect_engineer_projects_title', 'type' => 'text' )); $categories = get_categories(); $cat_post = array(); $cat_post[]= 'select'; $i = 0; foreach($categories as $category){ if($i==0){ $default = $category->slug; $i++; } $cat_post[$category->slug] = $category->name; } $wp_customize->add_setting('architect_engineer_projects_category',array( 'default' => 'select', 'sanitize_callback' => 'architect_engineer_sanitize_select', )); $wp_customize->add_control('architect_engineer_projects_category',array( 'type' => 'select', 'choices' => $cat_post, 'label' => __('Select category to display latest projects','architect-engineer'), 'section' => 'architect_engineer_new_project', )); // Pro Version $wp_customize->add_setting( 'pro_version_project_setting', array( 'sanitize_callback' => 'Architect_Engineer_sanitize_custom_control' )); $wp_customize->add_control( new Architect_Engineer_Customize_Pro_Version ( $wp_customize,'pro_version_project_setting', array( 'section' => 'architect_engineer_new_project', 'type' => 'pro_options', 'label' => esc_html__( 'Customizer Options', 'architect-engineer' ), 'description' => esc_url( ARCHITECT_ENGINNER_URL ), 'priority' => 100 ))); // Footer $wp_customize->add_section('architect_engineer_site_footer_section', array( 'title' => esc_html__('Footer', 'architect-engineer'), )); $wp_customize->add_setting('architect_engineer_show_hide_footer',array( 'default' => true, 'sanitize_callback' => 'architect_engineer_sanitize_checkbox' )); $wp_customize->add_control('architect_engineer_show_hide_footer',array( 'type' => 'checkbox', 'label' => __('Show / Hide Footer','architect-engineer'), 'section' => 'architect_engineer_site_footer_section', 'priority' => 1, )); $wp_customize->add_setting('architect_engineer_footer_bg_image',array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize,'architect_engineer_footer_bg_image',array( 'label' => __('Footer Background Image','architect-engineer'), 'section' => 'architect_engineer_site_footer_section', 'priority' => 1, ))); $wp_customize->add_setting('architect_engineer_footer_bg_image_position',array( 'default'=> 'scroll', 'sanitize_callback' => 'architect_engineer_sanitize_choices' )); $wp_customize->add_control('architect_engineer_footer_bg_image_position',array( 'type' => 'select', 'label' => __('Footer Background Image Position','architect-engineer'), 'choices' => array( 'fixed' => __('fixed','architect-engineer'), 'scroll' => __('scroll','architect-engineer'), ), 'section'=> 'architect_engineer_site_footer_section', )); $wp_customize->add_setting('architect_engineer_footer_widget_heading_alignment',array( 'default' => 'Left', 'transport' => 'refresh', 'sanitize_callback' => 'architect_engineer_sanitize_choices' )); $wp_customize->add_control('architect_engineer_footer_widget_heading_alignment',array( 'type' => 'select', 'label' => __('Footer Widget Heading Alignment','architect-engineer'), 'section' => 'architect_engineer_site_footer_section', 'choices' => array( 'Left' => __('Left','architect-engineer'), 'Center' => __('Center','architect-engineer'), 'Right' => __('Right','architect-engineer') ), ) ); $wp_customize->add_setting('architect_engineer_footer_widget_content_alignment',array( 'default' => 'Left', 'transport' => 'refresh', 'sanitize_callback' => 'architect_engineer_sanitize_choices' )); $wp_customize->add_control('architect_engineer_footer_widget_content_alignment',array( 'type' => 'select', 'label' => __('Footer Widget Content Alignment','architect-engineer'), 'section' => 'architect_engineer_site_footer_section', 'choices' => array( 'Left' => __('Left','architect-engineer'), 'Center' => __('Center','architect-engineer'), 'Right' => __('Right','architect-engineer') ), ) ); $wp_customize->add_setting('architect_engineer_show_hide_copyright',array( 'default' => true, 'sanitize_callback' => 'architect_engineer_sanitize_checkbox' )); $wp_customize->add_control('architect_engineer_show_hide_copyright',array( 'type' => 'checkbox', 'label' => __('Show / Hide Copyright','architect-engineer'), 'section' => 'architect_engineer_site_footer_section', )); $wp_customize->add_setting('architect_engineer_footer_text_setting', array( 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('architect_engineer_footer_text_setting', array( 'label' => __('Replace the footer text', 'architect-engineer'), 'section' => 'architect_engineer_site_footer_section', 'type' => 'text', )); $wp_customize->add_setting('architect_engineer_copyright_content_alignment',array( 'default' => 'Right', 'transport' => 'refresh', 'sanitize_callback' => 'architect_engineer_sanitize_choices' )); $wp_customize->add_control('architect_engineer_copyright_content_alignment',array( 'type' => 'select', 'label' => __('Copyright Content Alignment','architect-engineer'), 'section' => 'architect_engineer_site_footer_section', 'choices' => array( 'Left' => __('Left','architect-engineer'), 'Center' => __('Center','architect-engineer'), 'Right' => __('Right','architect-engineer') ), ) ); $wp_customize->add_setting('architect_engineer_copyright_background_color', array( 'default' => '', 'sanitize_callback' => 'sanitize_hex_color', )); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'architect_engineer_copyright_background_color', array( 'label' => __('Copyright Background Color', 'architect-engineer'), 'section' => 'architect_engineer_site_footer_section', ))); // Pro Version $wp_customize->add_setting( 'pro_version_footer_setting', array( 'sanitize_callback' => 'Architect_Engineer_sanitize_custom_control' )); $wp_customize->add_control( new Architect_Engineer_Customize_Pro_Version ( $wp_customize,'pro_version_footer_setting', array( 'section' => 'architect_engineer_site_footer_section', 'type' => 'pro_options', 'label' => esc_html__( 'Customizer Options', 'architect-engineer' ), 'description' => esc_url( ARCHITECT_ENGINNER_URL ), 'priority' => 100 ))); } add_action('customize_register', 'architect_engineer_customize_register'); /** * Render the site title for the selective refresh partial. * * @return void */ function architect_engineer_customize_partial_blogname(){ bloginfo('name'); } /** * Render the site tagline for the selective refresh partial. * * @return void */ function architect_engineer_customize_partial_blogdescription(){ bloginfo('description'); } /** * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. */ function architect_engineer_customize_preview_js(){ wp_enqueue_script('architect-engineer-customizer', esc_url(get_template_directory_uri()) . '/assets/js/customizer.js', array('customize-preview'), '20151215', true); } add_action('customize_preview_init', 'architect_engineer_customize_preview_js'); /* ** Load dynamic logic for the customizer controls area. */ function architect_engineer_panels_js() { wp_enqueue_style( 'architect-engineer-customizer-layout-css', get_theme_file_uri( '/assets/css/customizer-layout.css' ) ); wp_enqueue_script( 'architect-engineer-customize-layout', get_theme_file_uri( '/assets/js/customize-layout.js' ), array(), '1.2', true ); } add_action( 'customize_controls_enqueue_scripts', 'architect_engineer_panels_js' );