add_panel( 'general_settings', array( 'priority' => 60, 'capability' => 'edit_theme_options', 'title' => __( 'General Settings', 'blossom-shop' ), 'description' => __( 'Customize Header, Social, Sharing, SEO, Post/Page, Newsletter, Performance and Miscellaneous settings.', 'blossom-shop' ), ) ); /** Header Settings */ $wp_customize->add_section( 'header_settings', array( 'title' => __( 'Header Settings', 'blossom-shop' ), 'priority' => 20, 'panel' => 'general_settings', ) ); $wp_customize->add_setting( 'ed_top_bar', array( 'default' => false, 'sanitize_callback' => 'blossom_shop_sanitize_checkbox', ) ); $wp_customize->add_control( new Blossom_Shop_Toggle_Control( $wp_customize, 'ed_top_bar', array( 'section' => 'header_settings', 'label' => __( 'Enable Top Bar', 'blossom-shop' ), 'description' => __( 'Enable to show topbar in header.', 'blossom-shop' ), ) ) ); /** Sticky Text */ $wp_customize->add_setting( 'notification_text', array( 'default' => __( 'End of Season SALE now on thru 1/21.','blossom-shop' ), 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'notification_text', array( 'type' => 'text', 'section' => 'header_settings', 'label' => __( 'Title', 'blossom-shop' ), 'active_callback' => 'blossom_shop_topbar_ac' ) ); $wp_customize->selective_refresh->add_partial( 'notification_text', array( 'selector' => '.sticky-bar-content .container span', 'render_callback' => 'blossom_shop_get_sticky_text', ) ); /** Sticky Button */ $wp_customize->add_setting( 'notification_label', array( 'default' => __( 'SHOP NOW','blossom-shop' ), 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'notification_label', array( 'type' => 'text', 'section' => 'header_settings', 'label' => __( 'Button Label', 'blossom-shop' ), 'active_callback' => 'blossom_shop_topbar_ac' ) ); $wp_customize->selective_refresh->add_partial( 'notification_label', array( 'selector' => '.sticky-bar-content .container a.btn-readmore', 'render_callback' => 'blossom_shop_get_sticky_button', ) ); /** Sticky Button URL*/ $wp_customize->add_setting( 'notification_btn_url', array( 'default' => '#', 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( 'notification_btn_url', array( 'type' => 'url', 'section' => 'header_settings', 'label' => __( 'Button URL', 'blossom-shop' ), 'active_callback' => 'blossom_shop_topbar_ac' ) ); /** Enable Header Search */ $wp_customize->add_setting( 'ed_header_search', array( 'default' => true, 'sanitize_callback' => 'blossom_shop_sanitize_checkbox' ) ); $wp_customize->add_control( new Blossom_Shop_Toggle_Control( $wp_customize, 'ed_header_search', array( 'section' => 'header_settings', 'label' => __( 'Enable Header Search', 'blossom-shop' ), 'description' => __( 'Enable to show Search button in header.', 'blossom-shop' ), ) ) ); /** User Login */ $wp_customize->add_setting( 'ed_user_login', array( 'default' => true, 'sanitize_callback' => 'blossom_shop_sanitize_checkbox' ) ); $wp_customize->add_control( new Blossom_Shop_Toggle_Control( $wp_customize, 'ed_user_login', array( 'section' => 'header_settings', 'label' => __( 'User Login', 'blossom-shop' ), 'description' => __( 'Enable to show user login in the header.', 'blossom-shop' ), 'active_callback' => 'blossom_shop_is_woocommerce_activated', ) ) ); /** Shopping Cart */ $wp_customize->add_setting( 'ed_shopping_cart', array( 'default' => true, 'sanitize_callback' => 'blossom_shop_sanitize_checkbox' ) ); $wp_customize->add_control( new Blossom_Shop_Toggle_Control( $wp_customize, 'ed_shopping_cart', array( 'section' => 'header_settings', 'label' => __( 'Shopping Cart', 'blossom-shop' ), 'description' => __( 'Enable to show Shopping cart in the header.', 'blossom-shop' ), 'active_callback' => 'blossom_shop_is_woocommerce_activated' ) ) ); /** Header Settings Ends */ /** Social Media Settings */ $wp_customize->add_section( 'social_media_settings', array( 'title' => __( 'Social Media Settings', 'blossom-shop' ), 'priority' => 30, 'panel' => 'general_settings', ) ); /** Enable Social Links */ $wp_customize->add_setting( 'ed_social_links', array( 'default' => true, 'sanitize_callback' => 'blossom_shop_sanitize_checkbox' ) ); $wp_customize->add_control( new Blossom_Shop_Toggle_Control( $wp_customize, 'ed_social_links', array( 'section' => 'social_media_settings', 'label' => __( 'Enable Social Links', 'blossom-shop' ), 'description' => __( 'Enable to show social links at header.', 'blossom-shop' ), ) ) ); $wp_customize->add_setting( new Blossom_Shop_Repeater_Setting( $wp_customize, 'social_links', array( 'default' => '', 'sanitize_callback' => array( 'Blossom_Shop_Repeater_Setting', 'sanitize_repeater_setting' ), ) ) ); $wp_customize->add_control( new Blossom_Shop_Control_Repeater( $wp_customize, 'social_links', array( 'section' => 'social_media_settings', 'label' => __( 'Social Links', 'blossom-shop' ), 'fields' => array( 'font' => array( 'type' => 'font', 'label' => __( 'Font Awesome Icon', 'blossom-shop' ), 'description' => __( 'Example: fab fa-facebook-f', 'blossom-shop' ), ), 'link' => array( 'type' => 'url', 'label' => __( 'Link', 'blossom-shop' ), 'description' => __( 'Example: https://facebook.com', 'blossom-shop' ), ) ), 'row_label' => array( 'type' => 'field', 'value' => __( 'links', 'blossom-shop' ), 'field' => 'link' ), 'choices' => array( 'limit' => 10 ) ) ) ); /** Social Media Settings Ends */ /** SEO Settings */ $wp_customize->add_section( 'seo_settings', array( 'title' => __( 'SEO Settings', 'blossom-shop' ), 'priority' => 40, 'panel' => 'general_settings', ) ); /** Enable Social Links */ $wp_customize->add_setting( 'ed_post_update_date', array( 'default' => true, 'sanitize_callback' => 'blossom_shop_sanitize_checkbox' ) ); $wp_customize->add_control( new Blossom_Shop_Toggle_Control( $wp_customize, 'ed_post_update_date', array( 'section' => 'seo_settings', 'label' => __( 'Enable Last Update Post Date', 'blossom-shop' ), 'description' => __( 'Enable to show last updated post date on listing as well as in single post.', 'blossom-shop' ), ) ) ); /** Enable Social Links */ $wp_customize->add_setting( 'ed_breadcrumb', array( 'default' => true, 'sanitize_callback' => 'blossom_shop_sanitize_checkbox' ) ); $wp_customize->add_control( new Blossom_Shop_Toggle_Control( $wp_customize, 'ed_breadcrumb', array( 'section' => 'seo_settings', 'label' => __( 'Enable Breadcrumb', 'blossom-shop' ), 'description' => __( 'Enable to show breadcrumb in inner pages.', 'blossom-shop' ), ) ) ); /** Breadcrumb Home Text */ $wp_customize->add_setting( 'home_text', array( 'default' => __( 'Home', 'blossom-shop' ), 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'home_text', array( 'type' => 'text', 'section' => 'seo_settings', 'label' => __( 'Breadcrumb Home Text', 'blossom-shop' ), ) ); /** SEO Settings Ends */ /** Posts(Blog) & Pages Settings */ $wp_customize->add_section( 'post_page_settings', array( 'title' => __( 'Posts(Blog) & Pages Settings', 'blossom-shop' ), 'priority' => 50, 'panel' => 'general_settings', ) ); /** Prefix Archive Page */ $wp_customize->add_setting( 'ed_prefix_archive', array( 'default' => true, 'sanitize_callback' => 'blossom_shop_sanitize_checkbox' ) ); $wp_customize->add_control( new Blossom_Shop_Toggle_Control( $wp_customize, 'ed_prefix_archive', array( 'section' => 'post_page_settings', 'label' => __( 'Hide Prefix in Archive Page', 'blossom-shop' ), 'description' => __( 'Enable to hide prefix in archive page.', 'blossom-shop' ), ) ) ); /** Blog Excerpt */ $wp_customize->add_setting( 'ed_excerpt', array( 'default' => true, 'sanitize_callback' => 'blossom_shop_sanitize_checkbox' ) ); $wp_customize->add_control( new Blossom_Shop_Toggle_Control( $wp_customize, 'ed_excerpt', array( 'section' => 'post_page_settings', 'label' => __( 'Enable Blog Excerpt', 'blossom-shop' ), 'description' => __( 'Enable to show excerpt or disable to show full post content.', 'blossom-shop' ), ) ) ); /** Excerpt Length */ $wp_customize->add_setting( 'excerpt_length', array( 'default' => 55, 'sanitize_callback' => 'blossom_shop_sanitize_number_absint' ) ); $wp_customize->add_control( new blossom_shop_Slider_Control( $wp_customize, 'excerpt_length', array( 'section' => 'post_page_settings', 'label' => __( 'Excerpt Length', 'blossom-shop' ), 'description' => __( 'Automatically generated excerpt length (in words).', 'blossom-shop' ), 'choices' => array( 'min' => 10, 'max' => 100, 'step' => 5, ) ) ) ); /** Read More Text */ $wp_customize->add_setting( 'read_more_text', array( 'default' => __( 'READ MORE', 'blossom-shop' ), 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage' ) ); $wp_customize->add_control( 'read_more_text', array( 'type' => 'text', 'section' => 'post_page_settings', 'label' => __( 'Read More Text', 'blossom-shop' ), ) ); $wp_customize->selective_refresh->add_partial( 'read_more_text', array( 'selector' => '.entry-footer .btn-readmore', 'render_callback' => 'blossom_shop_get_read_more', ) ); /** Note */ $wp_customize->add_setting( 'post_note_text', array( 'default' => '', 'sanitize_callback' => 'wp_kses_post' ) ); $wp_customize->add_control( new Blossom_Shop_Note_Control( $wp_customize, 'post_note_text', array( 'section' => 'post_page_settings', 'description' => sprintf( __( '%s These options affect your individual posts.', 'blossom-shop' ), '