register_section_type( Business_Lawyer_Firm_Button::class );
$manager->add_section(
new Business_Lawyer_Firm_Button( $manager, 'business_lawyer_firm_pro', [
'title' => __( 'Lawyer Firm Pro', 'business-lawyer-firm' ),
'priority' => 0,
'button_text' => __( 'GET PREMIUM', 'business-lawyer-firm' ),
'button_url' => esc_url( 'https://www.themagnifico.net/products/lawyer-wordpress-theme/', 'business-lawyer-firm')
] )
);
} );
// Load the JS and CSS.
add_action( 'customize_controls_enqueue_scripts', function() {
$version = wp_get_theme()->get( 'Version' );
wp_enqueue_script(
'business-lawyer-firm-customize-section-button',
get_theme_file_uri( 'vendor/wptrt/customize-section-button/public/js/customize-controls.js' ),
[ 'customize-controls' ],
$version,
true
);
wp_enqueue_style(
'business-lawyer-firm-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 business_lawyer_firm_customize_register($wp_customize){
// Pro Version
class Business_Lawyer_Firm_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( BUSINESS_LAWYER_FIRM_BUY_TEXT,'business-lawyer-firm' ) .'';
echo '';
}
}
// Custom Controls
function Business_Lawyer_Firm_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('business_lawyer_firm_logo_max_height',array(
'default' => '24',
'sanitize_callback' => 'business_lawyer_firm_sanitize_number_absint'
));
$wp_customize->add_control('business_lawyer_firm_logo_max_height',array(
'label' => esc_html__('Logo Width','business-lawyer-firm'),
'section' => 'title_tagline',
'type' => 'number'
));
$wp_customize->add_setting('business_lawyer_firm_logo_title', array(
'default' => true,
'sanitize_callback' => 'business_lawyer_firm_sanitize_checkbox'
));
$wp_customize->add_control( new WP_Customize_Control($wp_customize,'business_lawyer_firm_logo_title',array(
'label' => __( 'Enable Disable Title', 'business-lawyer-firm' ),
'section' => 'title_tagline',
'settings' => 'business_lawyer_firm_logo_title',
'type' => 'checkbox',
)));
$wp_customize->add_setting('business_lawyer_firm_theme_description', array(
'default' => false,
'sanitize_callback' => 'business_lawyer_firm_sanitize_checkbox'
));
$wp_customize->add_control( new WP_Customize_Control($wp_customize,'business_lawyer_firm_theme_description',array(
'label' => __( 'Enable Disable Tagline', 'business-lawyer-firm' ),
'section' => 'title_tagline',
'settings' => 'business_lawyer_firm_theme_description',
'type' => 'checkbox',
)));
$wp_customize->add_setting('business_lawyer_firm_logo_title_color', array(
'default' => '',
'sanitize_callback' => 'sanitize_hex_color',
));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'business_lawyer_firm_logo_title_color', array(
'label' => __('Site Title Color', 'business-lawyer-firm'),
'section' => 'title_tagline'
)));
$wp_customize->add_setting('business_lawyer_firm_logo_tagline_color', array(
'default' => '',
'sanitize_callback' => 'sanitize_hex_color',
));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'business_lawyer_firm_logo_tagline_color', array(
'label' => __('Site Tagline Color', 'business-lawyer-firm'),
'section' => 'title_tagline'
)));
// Pro Version
$wp_customize->add_setting( 'pro_version_logo', array(
'sanitize_callback' => 'Business_Lawyer_Firm_sanitize_custom_control'
));
$wp_customize->add_control( new Business_Lawyer_Firm_Customize_Pro_Version ( $wp_customize,'pro_version_logo', array(
'section' => 'title_tagline',
'type' => 'pro_options',
'label' => esc_html__( 'Customizer Options', 'business-lawyer-firm' ),
'description' => esc_url( BUSINESS_LAWYER_FIRM_URL ),
'priority' => 100
)));
// Theme Color
$wp_customize->add_section('business_lawyer_firm_color_option',array(
'title' => esc_html__('Theme Color','business-lawyer-firm'),
'priority' => 10
));
$wp_customize->add_setting( 'business_lawyer_firm_theme_color', array(
'default' => '#0d0f42',
'sanitize_callback' => 'sanitize_hex_color'
));
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'business_lawyer_firm_theme_color', array(
'label' => esc_html__('First Color Option','business-lawyer-firm'),
'section' => 'business_lawyer_firm_color_option',
'settings' => 'business_lawyer_firm_theme_color'
)));
$wp_customize->add_setting( 'business_lawyer_firm_theme_color_2', array(
'default' => '#b12d40',
'sanitize_callback' => 'sanitize_hex_color'
));
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'business_lawyer_firm_theme_color_2', array(
'label' => esc_html__('Second Color Option','business-lawyer-firm'),
'section' => 'business_lawyer_firm_color_option',
'settings' => 'business_lawyer_firm_theme_color_2'
)));
// Pro Version
$wp_customize->add_setting( 'pro_version_theme_color', array(
'sanitize_callback' => 'Business_Lawyer_Firm_sanitize_custom_control'
));
$wp_customize->add_control( new Business_Lawyer_Firm_Customize_Pro_Version ( $wp_customize,'pro_version_theme_color', array(
'section' => 'business_lawyer_firm_color_option',
'type' => 'pro_options',
'label' => esc_html__( 'Customizer Options', 'business-lawyer-firm' ),
'description' => esc_url( BUSINESS_LAWYER_FIRM_URL ),
'priority' => 100
)));
// General Settings
$wp_customize->add_section('business_lawyer_firm_general_settings',array(
'title' => esc_html__('General Settings','business-lawyer-firm'),
'priority' => 30,
));
$wp_customize->add_setting('business_lawyer_firm_preloader_hide', array(
'default' => false,
'sanitize_callback' => 'business_lawyer_firm_sanitize_checkbox'
));
$wp_customize->add_control( new WP_Customize_Control($wp_customize,'business_lawyer_firm_preloader_hide',array(
'label' => __( 'Show Theme Preloader', 'business-lawyer-firm' ),
'section' => 'business_lawyer_firm_general_settings',
'settings' => 'business_lawyer_firm_preloader_hide',
'type' => 'checkbox',
)));
$wp_customize->add_setting( 'business_lawyer_firm_preloader_bg_color', array(
'default' => '#000',
'sanitize_callback' => 'sanitize_hex_color'
));
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'business_lawyer_firm_preloader_bg_color', array(
'label' => esc_html__('Preloader Background Color','business-lawyer-firm'),
'section' => 'business_lawyer_firm_general_settings',
'settings' => 'business_lawyer_firm_preloader_bg_color'
)));
$wp_customize->add_setting( 'business_lawyer_firm_preloader_dot_1_color', array(
'default' => '#fff',
'sanitize_callback' => 'sanitize_hex_color'
));
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'business_lawyer_firm_preloader_dot_1_color', array(
'label' => esc_html__('Preloader First Dot Color','business-lawyer-firm'),
'section' => 'business_lawyer_firm_general_settings',
'settings' => 'business_lawyer_firm_preloader_dot_1_color'
)));
$wp_customize->add_setting( 'business_lawyer_firm_preloader_dot_2_color', array(
'default' => '#b12d40',
'sanitize_callback' => 'sanitize_hex_color'
));
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'business_lawyer_firm_preloader_dot_2_color', array(
'label' => esc_html__('Preloader Second Dot Color','business-lawyer-firm'),
'section' => 'business_lawyer_firm_general_settings',
'settings' => 'business_lawyer_firm_preloader_dot_2_color'
)));
$wp_customize->add_setting('business_lawyer_firm_scroll_hide', array(
'default' => false,
'sanitize_callback' => 'business_lawyer_firm_sanitize_checkbox'
));
$wp_customize->add_control( new WP_Customize_Control($wp_customize,'business_lawyer_firm_scroll_hide',array(
'label' => __( 'Show Theme Scroll To Top', 'business-lawyer-firm' ),
'section' => 'business_lawyer_firm_general_settings',
'settings' => 'business_lawyer_firm_scroll_hide',
'type' => 'checkbox',
)));
$wp_customize->add_setting('business_lawyer_firm_scroll_top_position',array(
'default' => 'Right',
'sanitize_callback' => 'business_lawyer_firm_sanitize_choices'
));
$wp_customize->add_control('business_lawyer_firm_scroll_top_position',array(
'type' => 'radio',
'section' => 'business_lawyer_firm_general_settings',
'choices' => array(
'Right' => __('Right','business-lawyer-firm'),
'Left' => __('Left','business-lawyer-firm'),
'Center' => __('Center','business-lawyer-firm')
),
) );
$wp_customize->add_setting('business_lawyer_firm_sticky_header', array(
'default' => false,
'sanitize_callback' => 'business_lawyer_firm_sanitize_checkbox'
));
$wp_customize->add_control( new WP_Customize_Control($wp_customize,'business_lawyer_firm_sticky_header',array(
'label' => __( 'Show Sticky Header', 'business-lawyer-firm' ),
'section' => 'business_lawyer_firm_general_settings',
'settings' => 'business_lawyer_firm_sticky_header',
'type' => 'checkbox',
)));
// Product Columns
$wp_customize->add_setting( 'business_lawyer_firm_products_per_row' , array(
'default' => '3',
'transport' => 'refresh',
'sanitize_callback' => 'business_lawyer_firm_sanitize_select',
) );
$wp_customize->add_control('business_lawyer_firm_products_per_row', array(
'label' => __( 'Product per row', 'business-lawyer-firm' ),
'section' => 'business_lawyer_firm_general_settings',
'type' => 'select',
'choices' => array(
'2' => '2',
'3' => '3',
'4' => '4',
),
) );
//Woocommerce shop page Sidebar
$wp_customize->add_setting('business_lawyer_firm_woocommerce_shop_page_sidebar', array(
'default' => true,
'sanitize_callback' => 'business_lawyer_firm_sanitize_checkbox'
));
$wp_customize->add_control( new WP_Customize_Control($wp_customize,'business_lawyer_firm_woocommerce_shop_page_sidebar',array(
'label' => __( 'Hide Shop Page Sidebar', 'business-lawyer-firm' ),
'section' => 'business_lawyer_firm_general_settings',
'settings' => 'business_lawyer_firm_woocommerce_shop_page_sidebar',
'type' => 'checkbox',
)));
$wp_customize->add_setting('business_lawyer_firm_shop_page_sidebar_layout',array(
'default' => 'Right Sidebar',
'sanitize_callback' => 'business_lawyer_firm_sanitize_choices'
));
$wp_customize->add_control('business_lawyer_firm_shop_page_sidebar_layout',array(
'type' => 'select',
'label' => __('Woocommerce Shop Page Sidebar','business-lawyer-firm'),
'section' => 'business_lawyer_firm_general_settings',
'choices' => array(
'Left Sidebar' => __('Left Sidebar','business-lawyer-firm'),
'Right Sidebar' => __('Right Sidebar','business-lawyer-firm'),
),
) );
//Woocommerce Single Product page Sidebar
$wp_customize->add_setting('business_lawyer_firm_woocommerce_single_product_page_sidebar', array(
'default' => true,
'sanitize_callback' => 'business_lawyer_firm_sanitize_checkbox'
));
$wp_customize->add_control( new WP_Customize_Control($wp_customize,'business_lawyer_firm_woocommerce_single_product_page_sidebar',array(
'label' => __( 'Hide Single Product Page Sidebar', 'business-lawyer-firm' ),
'section' => 'business_lawyer_firm_general_settings',
'settings' => 'business_lawyer_firm_woocommerce_single_product_page_sidebar',
'type' => 'checkbox',
)));
$wp_customize->add_setting('business_lawyer_firm_single_product_sidebar_layout',array(
'default' => 'Right Sidebar',
'sanitize_callback' => 'business_lawyer_firm_sanitize_choices'
));
$wp_customize->add_control('business_lawyer_firm_single_product_sidebar_layout',array(
'type' => 'select',
'label' => __('Woocommerce Single Product Page Sidebar','business-lawyer-firm'),
'section' => 'business_lawyer_firm_general_settings',
'choices' => array(
'Left Sidebar' => __('Left Sidebar','business-lawyer-firm'),
'Right Sidebar' => __('Right Sidebar','business-lawyer-firm'),
),
) );
$wp_customize->add_setting('business_lawyer_firm_woocommerce_product_sale',array(
'default' => 'Left',
'sanitize_callback' => 'business_lawyer_firm_sanitize_choices'
));
$wp_customize->add_control('business_lawyer_firm_woocommerce_product_sale',array(
'type' => 'radio',
'section' => 'business_lawyer_firm_general_settings',
'choices' => array(
'Right' => __('Right','business-lawyer-firm'),
'Left' => __('Left','business-lawyer-firm'),
'Center' => __('Center','business-lawyer-firm')
),
) );
// Related Product
$wp_customize->add_setting('business_lawyer_firm_woocommerce_related_product_show_hide', array(
'default' => true,
'sanitize_callback' => 'business_lawyer_firm_sanitize_checkbox'
));
$wp_customize->add_control( new WP_Customize_Control($wp_customize,'business_lawyer_firm_woocommerce_related_product_show_hide',array(
'label' => __( 'Show / Hide Related product', 'business-lawyer-firm' ),
'section' => 'business_lawyer_firm_general_settings',
'settings' => 'business_lawyer_firm_woocommerce_related_product_show_hide',
'type' => 'checkbox',
)));
// Pro Version
$wp_customize->add_setting( 'pro_version_general_setting', array(
'sanitize_callback' => 'Business_Lawyer_Firm_sanitize_custom_control'
));
$wp_customize->add_control( new Business_Lawyer_Firm_Customize_Pro_Version ( $wp_customize,'pro_version_general_setting', array(
'section' => 'business_lawyer_firm_general_settings',
'type' => 'pro_options',
'label' => esc_html__( 'Customizer Options', 'business-lawyer-firm' ),
'description' => esc_url( BUSINESS_LAWYER_FIRM_URL ),
'priority' => 100
)));
// Top Header
$wp_customize->add_section('business_lawyer_firm_top_header',array(
'title' => esc_html__('Top Header','business-lawyer-firm'),
));
$wp_customize->add_setting('business_lawyer_firm_time',array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('business_lawyer_firm_time',array(
'label' => esc_html__('Opening Time','business-lawyer-firm'),
'section' => 'business_lawyer_firm_top_header',
'setting' => 'business_lawyer_firm_time',
'type' => 'text'
));
$wp_customize->add_setting('business_lawyer_firm_location',array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('business_lawyer_firm_location',array(
'label' => esc_html__('Location','business-lawyer-firm'),
'section' => 'business_lawyer_firm_top_header',
'setting' => 'business_lawyer_firm_location',
'type' => 'text'
));
$wp_customize->add_setting('business_lawyer_firm_phone_number',array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('business_lawyer_firm_phone_number',array(
'label' => esc_html__('Phone Number','business-lawyer-firm'),
'section' => 'business_lawyer_firm_top_header',
'setting' => 'business_lawyer_firm_phone_number',
'type' => 'text'
));
$wp_customize->add_setting('business_lawyer_firm_email',array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('business_lawyer_firm_email',array(
'label' => esc_html__('Email Address','business-lawyer-firm'),
'section' => 'business_lawyer_firm_top_header',
'setting' => 'business_lawyer_firm_email',
'type' => 'text'
));
$wp_customize->add_setting('business_lawyer_firm_facebook_url',array(
'default' => '',
'sanitize_callback' => 'esc_url_raw'
));
$wp_customize->add_control('business_lawyer_firm_facebook_url',array(
'label' => esc_html__('Facebook Link','business-lawyer-firm'),
'section' => 'business_lawyer_firm_top_header',
'setting' => 'business_lawyer_firm_facebook_url',
'type' => 'url'
));
$wp_customize->add_setting('business_lawyer_firm_twitter_url',array(
'default' => '',
'sanitize_callback' => 'esc_url_raw'
));
$wp_customize->add_control('business_lawyer_firm_twitter_url',array(
'label' => esc_html__('Twitter Link','business-lawyer-firm'),
'section' => 'business_lawyer_firm_top_header',
'setting' => 'business_lawyer_firm_twitter_url',
'type' => 'url'
));
$wp_customize->add_setting('business_lawyer_firm_intagram_url',array(
'default' => '',
'sanitize_callback' => 'esc_url_raw'
));
$wp_customize->add_control('business_lawyer_firm_intagram_url',array(
'label' => esc_html__('Intagram Link','business-lawyer-firm'),
'section' => 'business_lawyer_firm_top_header',
'setting' => 'business_lawyer_firm_intagram_url',
'type' => 'url'
));
$wp_customize->add_setting('business_lawyer_firm_linkedin_url',array(
'default' => '',
'sanitize_callback' => 'esc_url_raw'
));
$wp_customize->add_control('business_lawyer_firm_linkedin_url',array(
'label' => esc_html__('Linkedin Link','business-lawyer-firm'),
'section' => 'business_lawyer_firm_top_header',
'setting' => 'business_lawyer_firm_linkedin_url',
'type' => 'url'
));
$wp_customize->add_setting('business_lawyer_firm_pintrest_url',array(
'default' => '',
'sanitize_callback' => 'esc_url_raw'
));
$wp_customize->add_control('business_lawyer_firm_pintrest_url',array(
'label' => esc_html__('Pinterest Link','business-lawyer-firm'),
'section' => 'business_lawyer_firm_top_header',
'setting' => 'business_lawyer_firm_pintrest_url',
'type' => 'url'
));
// Pro Version
$wp_customize->add_setting( 'pro_version_top_header_setting', array(
'sanitize_callback' => 'Business_Lawyer_Firm_sanitize_custom_control'
));
$wp_customize->add_control( new Business_Lawyer_Firm_Customize_Pro_Version ( $wp_customize,'pro_version_top_header_setting', array(
'section' => 'business_lawyer_firm_top_header',
'type' => 'pro_options',
'label' => esc_html__( 'Customizer Options', 'business-lawyer-firm' ),
'description' => esc_url( BUSINESS_LAWYER_FIRM_URL ),
'priority' => 100
)));
// Header
$wp_customize->add_section('business_lawyer_firm_header',array(
'title' => esc_html__('Header','business-lawyer-firm')
));
$wp_customize->add_setting('business_lawyer_firm_tropy_title',array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('business_lawyer_firm_tropy_title',array(
'label' => esc_html__('Heading 1','business-lawyer-firm'),
'section' => 'business_lawyer_firm_header',
'setting' => 'business_lawyer_firm_tropy_title',
'type' => 'text'
));
$wp_customize->add_setting('business_lawyer_firm_tropy_text',array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('business_lawyer_firm_tropy_text',array(
'label' => esc_html__('Text 1','business-lawyer-firm'),
'section' => 'business_lawyer_firm_header',
'setting' => 'business_lawyer_firm_tropy_text',
'type' => 'text'
));
$wp_customize->add_setting('business_lawyer_firm_trusted_title',array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('business_lawyer_firm_trusted_title',array(
'label' => esc_html__('Heading 2','business-lawyer-firm'),
'section' => 'business_lawyer_firm_header',
'setting' => 'business_lawyer_firm_trusted_title',
'type' => 'text'
));
$wp_customize->add_setting('business_lawyer_firm_trusted_text',array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('business_lawyer_firm_trusted_text',array(
'label' => esc_html__('Text 2','business-lawyer-firm'),
'section' => 'business_lawyer_firm_header',
'setting' => 'business_lawyer_firm_trusted_text',
'type' => 'text'
));
$wp_customize->add_setting('business_lawyer_firm_star_title',array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('business_lawyer_firm_star_title',array(
'label' => esc_html__('Heading 3','business-lawyer-firm'),
'section' => 'business_lawyer_firm_header',
'setting' => 'business_lawyer_firm_star_title',
'type' => 'text'
));
$wp_customize->add_setting('business_lawyer_firm_star_text',array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('business_lawyer_firm_star_text',array(
'label' => esc_html__('Text 3','business-lawyer-firm'),
'section' => 'business_lawyer_firm_header',
'setting' => 'business_lawyer_firm_star_text',
'type' => 'text'
));
$wp_customize->add_setting('business_lawyer_firm_consultation_button',array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('business_lawyer_firm_consultation_button',array(
'label' => esc_html__('Consultation Button Text','business-lawyer-firm'),
'section' => 'business_lawyer_firm_header',
'setting' => 'business_lawyer_firm_consultation_button',
'type' => 'text'
));
$wp_customize->add_setting('business_lawyer_firm_consultation_button_url',array(
'default' => '',
'sanitize_callback' => 'esc_url_raw'
));
$wp_customize->add_control('business_lawyer_firm_consultation_button_url',array(
'label' => esc_html__('Consultation Button Link','business-lawyer-firm'),
'section' => 'business_lawyer_firm_header',
'setting' => 'business_lawyer_firm_consultation_button_url',
'type' => 'url'
));
// Pro Version
$wp_customize->add_setting( 'pro_version_header_setting', array(
'sanitize_callback' => 'Business_Lawyer_Firm_sanitize_custom_control'
));
$wp_customize->add_control( new Business_Lawyer_Firm_Customize_Pro_Version ( $wp_customize,'pro_version_header_setting', array(
'section' => 'business_lawyer_firm_header',
'type' => 'pro_options',
'label' => esc_html__( 'Customizer Options', 'business-lawyer-firm' ),
'description' => esc_url( BUSINESS_LAWYER_FIRM_URL ),
'priority' => 100
)));
//Slider
$wp_customize->add_section('business_lawyer_firm_top_slider',array(
'title' => esc_html__('Slider Option','business-lawyer-firm')
));
$wp_customize->add_setting('business_lawyer_firm_slider_setting', array(
'default' => 0,
'sanitize_callback' => 'business_lawyer_firm_sanitize_checkbox'
));
$wp_customize->add_control( new WP_Customize_Control($wp_customize,'business_lawyer_firm_slider_setting',array(
'label' => __( 'Enable Disable Slider', 'business-lawyer-firm' ),
'section' => 'business_lawyer_firm_top_slider',
'settings' => 'business_lawyer_firm_slider_setting',
'type' => 'checkbox',
)));
for ( $business_lawyer_firm_count = 1; $business_lawyer_firm_count <= 3; $business_lawyer_firm_count++ ) {
$wp_customize->add_setting( 'business_lawyer_firm_top_slider_page' . $business_lawyer_firm_count, array(
'default' => '',
'sanitize_callback' => 'business_lawyer_firm_sanitize_dropdown_pages'
) );
$wp_customize->add_control( 'business_lawyer_firm_top_slider_page' . $business_lawyer_firm_count, array(
'label' => __( 'Select Slide Page', 'business-lawyer-firm' ),
'section' => 'business_lawyer_firm_top_slider',
'type' => 'dropdown-pages'
) );
}
//Slider Image Opacity
$wp_customize->add_setting('business_lawyer_firm_slider_opacity_color',array(
'default' => '',
'sanitize_callback' => 'business_lawyer_firm_sanitize_choices'
));
$wp_customize->add_control( 'business_lawyer_firm_slider_opacity_color', array(
'label' => esc_html__( 'Slider Image Opacity','business-lawyer-firm' ),
'section' => 'business_lawyer_firm_top_slider',
'type' => 'select',
'choices' => array(
'0' => esc_attr('0','business-lawyer-firm'),
'0.1' => esc_attr('0.1','business-lawyer-firm'),
'0.2' => esc_attr('0.2','business-lawyer-firm'),
'0.3' => esc_attr('0.3','business-lawyer-firm'),
'0.4' => esc_attr('0.4','business-lawyer-firm'),
'0.5' => esc_attr('0.5','business-lawyer-firm'),
'0.6' => esc_attr('0.6','business-lawyer-firm'),
'0.7' => esc_attr('0.7','business-lawyer-firm'),
'0.8' => esc_attr('0.8','business-lawyer-firm'),
'0.9' => esc_attr('0.9','business-lawyer-firm')
),
));
//Slider height
$wp_customize->add_setting('business_lawyer_firm_slider_img_height',array(
'default'=> '',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('business_lawyer_firm_slider_img_height',array(
'label' => __('Slider Height','business-lawyer-firm'),
'description' => __('Add the slider height in px(eg. 500px).','business-lawyer-firm'),
'input_attrs' => array(
'placeholder' => __( '500px', 'business-lawyer-firm' ),
),
'section'=> 'business_lawyer_firm_top_slider',
'type'=> 'text'
));
// Pro Version
$wp_customize->add_setting( 'pro_version_slider_setting', array(
'sanitize_callback' => 'Business_Lawyer_Firm_sanitize_custom_control'
));
$wp_customize->add_control( new Business_Lawyer_Firm_Customize_Pro_Version ( $wp_customize,'pro_version_slider_setting', array(
'section' => 'business_lawyer_firm_top_slider',
'type' => 'pro_options',
'label' => esc_html__( 'Customizer Options', 'business-lawyer-firm' ),
'description' => esc_url( BUSINESS_LAWYER_FIRM_URL ),
'priority' => 100
)));
// Project Section
$wp_customize->add_section('business_lawyer_firm_latest_project',array(
'title' => esc_html__('Latest Project Option','business-lawyer-firm')
));
$wp_customize->add_setting('business_lawyer_firm_projects_title',array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('business_lawyer_firm_projects_title',array(
'label' => esc_html__('Section Title','business-lawyer-firm'),
'section' => 'business_lawyer_firm_latest_project',
'setting' => 'business_lawyer_firm_projects_title',
'type' => 'text'
));
$wp_customize->add_setting('business_lawyer_firm_projects_text',array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('business_lawyer_firm_projects_text',array(
'label' => esc_html__('Section Text','business-lawyer-firm'),
'section' => 'business_lawyer_firm_latest_project',
'setting' => 'business_lawyer_firm_projects_text',
'type' => 'text'
));
$business_lawyer_firm_args = array('numberposts' => -1);
$post_list = get_posts($business_lawyer_firm_args);
$pst_sls[]= __('Select','business-lawyer-firm');
foreach ($post_list as $key => $p_post) {
$pst_sls[$p_post->ID]=$p_post->post_title;
}
$wp_customize->add_setting('business_lawyer_firm_project_section',array(
'sanitize_callback' => 'business_lawyer_firm_sanitize_choices',
));
$wp_customize->add_control('business_lawyer_firm_project_section',array(
'type' => 'select',
'choices' => $pst_sls,
'label' => __('Select Post','business-lawyer-firm'),
'description' => esc_html__('Here you have to select post in below dropdown. Image Dimension ( 580px x 580px )','business-lawyer-firm'),
'section' => 'business_lawyer_firm_latest_project',
));
wp_reset_postdata();
$business_lawyer_firm_args = array('numberposts' => -1);
$post_list = get_posts($business_lawyer_firm_args);
$i = 0;
$pst_sls[]= __('Select','business-lawyer-firm');
foreach ($post_list as $key => $p_post) {
$pst_sls[$p_post->ID]=$p_post->post_title;
}
for ( $i = 1; $i <= 4; $i++ ) {
$wp_customize->add_setting('business_lawyer_firm_other_project_section'.$i,array(
'sanitize_callback' => 'business_lawyer_firm_sanitize_choices',
));
$wp_customize->add_control('business_lawyer_firm_other_project_section'.$i,array(
'type' => 'select',
'choices' => $pst_sls,
'label' => __('Select Post','business-lawyer-firm'),
'description' => esc_html__('Here you have to select post in below dropdown. Image Dimension ( 260px x 260px )','business-lawyer-firm'),
'section' => 'business_lawyer_firm_latest_project',
));
}
wp_reset_postdata();
// Pro Version
$wp_customize->add_setting( 'pro_version_project_setting', array(
'sanitize_callback' => 'Business_Lawyer_Firm_sanitize_custom_control'
));
$wp_customize->add_control( new Business_Lawyer_Firm_Customize_Pro_Version ( $wp_customize,'pro_version_project_setting', array(
'section' => 'business_lawyer_firm_latest_project',
'type' => 'pro_options',
'label' => esc_html__( 'Customizer Options', 'business-lawyer-firm' ),
'description' => esc_url( BUSINESS_LAWYER_FIRM_URL ),
'priority' => 100
)));
// Footer
$wp_customize->add_section('business_lawyer_firm_site_footer_section', array(
'title' => esc_html__('Footer', 'business-lawyer-firm'),
));
$wp_customize->add_setting('business_lawyer_firm_footer_bg_image',array(
'default' => '',
'sanitize_callback' => 'esc_url_raw',
));
$wp_customize->add_control( new WP_Customize_Image_Control($wp_customize,'business_lawyer_firm_footer_bg_image',array(
'label' => __('Footer Background Image','business-lawyer-firm'),
'section' => 'business_lawyer_firm_site_footer_section',
'priority' => 1,
)));
$wp_customize->add_setting('business_lawyer_firm_footer_text_setting', array(
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('business_lawyer_firm_footer_text_setting', array(
'label' => __('Replace the footer text', 'business-lawyer-firm'),
'section' => 'business_lawyer_firm_site_footer_section',
'priority' => 1,
'type' => 'text',
));
$wp_customize->add_setting('business_lawyer_firm_show_hide_copyright',array(
'default' => true,
'sanitize_callback' => 'business_lawyer_firm_sanitize_checkbox'
));
$wp_customize->add_control('business_lawyer_firm_show_hide_copyright',array(
'type' => 'checkbox',
'label' => __('Show / Hide Copyright','business-lawyer-firm'),
'section' => 'business_lawyer_firm_site_footer_section',
));
$wp_customize->add_setting('business_lawyer_firm_copyright_background_color', array(
'default' => '',
'sanitize_callback' => 'sanitize_hex_color',
));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'business_lawyer_firm_copyright_background_color', array(
'label' => __('Copyright Background Color', 'business-lawyer-firm'),
'section' => 'business_lawyer_firm_site_footer_section',
)));
// Pro Version
$wp_customize->add_setting( 'pro_version_footer_setting', array(
'sanitize_callback' => 'Business_Lawyer_Firm_sanitize_custom_control'
));
$wp_customize->add_control( new Business_Lawyer_Firm_Customize_Pro_Version ( $wp_customize,'pro_version_footer_setting', array(
'section' => 'business_lawyer_firm_site_footer_section',
'type' => 'pro_options',
'label' => esc_html__( 'Customizer Options', 'business-lawyer-firm' ),
'description' => esc_url( BUSINESS_LAWYER_FIRM_URL ),
'priority' => 100
)));
// Post Settings
$wp_customize->add_section('business_lawyer_firm_post_settings',array(
'title' => esc_html__('Post Settings','business-lawyer-firm'),
'priority' =>40,
));
$wp_customize->add_setting('business_lawyer_firm_post_page_title',array(
'sanitize_callback' => 'business_lawyer_firm_sanitize_checkbox',
'default' => 1,
));
$wp_customize->add_control('business_lawyer_firm_post_page_title',array(
'type' => 'checkbox',
'label' => esc_html__('Enable Post Page Title', 'business-lawyer-firm'),
'section' => 'business_lawyer_firm_post_settings',
'description' => esc_html__('Check this box to enable title on post page.', 'business-lawyer-firm'),
));
$wp_customize->add_setting('business_lawyer_firm_post_page_meta',array(
'sanitize_callback' => 'business_lawyer_firm_sanitize_checkbox',
'default' => 1,
));
$wp_customize->add_control('business_lawyer_firm_post_page_meta',array(
'type' => 'checkbox',
'label' => esc_html__('Enable Post Page Meta', 'business-lawyer-firm'),
'section' => 'business_lawyer_firm_post_settings',
'description' => esc_html__('Check this box to enable meta on post page.', 'business-lawyer-firm'),
));
$wp_customize->add_setting('business_lawyer_firm_post_page_button',array(
'sanitize_callback' => 'business_lawyer_firm_sanitize_checkbox',
'default' => 1,
));
$wp_customize->add_control('business_lawyer_firm_post_page_button',array(
'type' => 'checkbox',
'label' => esc_html__('Enable Post Page Button', 'business-lawyer-firm'),
'section' => 'business_lawyer_firm_post_settings',
'description' => esc_html__('Check this box to enable button on post page.', 'business-lawyer-firm'),
));
$wp_customize->add_setting( 'business_lawyer_firm_post_page_image_border_radius', array(
'default' => '0',
'transport' => 'refresh',
'sanitize_callback' => 'business_lawyer_firm_sanitize_number_range'
) );
$wp_customize->add_control( 'business_lawyer_firm_post_page_image_border_radius', array(
'label' => esc_html__( 'Post Page Image Border Radius','business-lawyer-firm' ),
'section' => 'business_lawyer_firm_post_settings',
'type' => 'range',
'input_attrs' => array(
'step' => 1,
'min' => 1,
'max' => 50,
),
) );
$wp_customize->add_setting('business_lawyer_firm_single_post_thumb',array(
'sanitize_callback' => 'business_lawyer_firm_sanitize_checkbox',
'default' => 1,
));
$wp_customize->add_control('business_lawyer_firm_single_post_thumb',array(
'type' => 'checkbox',
'label' => esc_html__('Enable Single Post Thumbnail', 'business-lawyer-firm'),
'section' => 'business_lawyer_firm_post_settings',
'description' => esc_html__('Check this box to enable post thumbnail on single post.', 'business-lawyer-firm'),
));
$wp_customize->add_setting('business_lawyer_firm_single_post_meta',array(
'sanitize_callback' => 'business_lawyer_firm_sanitize_checkbox',
'default' => 1,
));
$wp_customize->add_control('business_lawyer_firm_single_post_meta',array(
'type' => 'checkbox',
'label' => esc_html__('Enable Single Post Meta', 'business-lawyer-firm'),
'section' => 'business_lawyer_firm_post_settings',
'description' => esc_html__('Check this box to enable single post meta such as post date, author, category, comment etc.', 'business-lawyer-firm'),
));
$wp_customize->add_setting('business_lawyer_firm_single_post_title',array(
'sanitize_callback' => 'business_lawyer_firm_sanitize_checkbox',
'default' => 1,
));
$wp_customize->add_control('business_lawyer_firm_single_post_title',array(
'type' => 'checkbox',
'label' => esc_html__('Enable Single Post Title', 'business-lawyer-firm'),
'section' => 'business_lawyer_firm_post_settings',
'description' => esc_html__('Check this box to enable title on single post.', 'business-lawyer-firm'),
));
$wp_customize->add_setting('business_lawyer_firm_single_post_tags',array(
'sanitize_callback' => 'business_lawyer_firm_sanitize_checkbox',
'default' => 1,
));
$wp_customize->add_control('business_lawyer_firm_single_post_tags',array(
'type' => 'checkbox',
'label' => esc_html__('Enable Single Post Tags', 'business-lawyer-firm'),
'section' => 'business_lawyer_firm_post_settings',
'description' => esc_html__('Check this box to enable tags on single post.', 'business-lawyer-firm'),
));
$wp_customize->add_setting('business_lawyer_firm_single_post_navigation_show_hide',array(
'default' => true,
'sanitize_callback' => 'business_lawyer_firm_sanitize_checkbox'
));
$wp_customize->add_control('business_lawyer_firm_single_post_navigation_show_hide',array(
'type' => 'checkbox',
'label' => __('Show / Hide Post Navigation','business-lawyer-firm'),
'section' => 'business_lawyer_firm_post_settings',
));
$wp_customize->add_setting('business_lawyer_firm_single_post_comment_title',array(
'default'=> 'Leave a Reply',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('business_lawyer_firm_single_post_comment_title',array(
'label' => __('Add Comment Title','business-lawyer-firm'),
'input_attrs' => array(
'placeholder' => __( 'Leave a Reply', 'business-lawyer-firm' ),
),
'section'=> 'business_lawyer_firm_post_settings',
'type'=> 'text'
));
$wp_customize->add_setting('business_lawyer_firm_single_post_comment_btn_text',array(
'default'=> 'Post Comment',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('business_lawyer_firm_single_post_comment_btn_text',array(
'label' => __('Add Comment Button Text','business-lawyer-firm'),
'input_attrs' => array(
'placeholder' => __( 'Post Comment', 'business-lawyer-firm' ),
),
'section'=> 'business_lawyer_firm_post_settings',
'type'=> 'text'
));
// Pro Version
$wp_customize->add_setting( 'pro_version_post_setting', array(
'sanitize_callback' => 'Business_Lawyer_Firm_sanitize_custom_control'
));
$wp_customize->add_control( new Business_Lawyer_Firm_Customize_Pro_Version ( $wp_customize,'pro_version_post_setting', array(
'section' => 'business_lawyer_firm_post_settings',
'type' => 'pro_options',
'label' => esc_html__( 'Customizer Options', 'business-lawyer-firm' ),
'description' => esc_url( BUSINESS_LAWYER_FIRM_URL ),
'priority' => 100
)));
// Page Settings
$wp_customize->add_section('business_lawyer_firm_page_settings',array(
'title' => esc_html__('Page Settings','business-lawyer-firm'),
'priority' =>50,
));
$wp_customize->add_setting('business_lawyer_firm_single_page_title',array(
'sanitize_callback' => 'business_lawyer_firm_sanitize_checkbox',
'default' => 1,
));
$wp_customize->add_control('business_lawyer_firm_single_page_title',array(
'type' => 'checkbox',
'label' => esc_html__('Enable Single Page Title', 'business-lawyer-firm'),
'section' => 'business_lawyer_firm_page_settings',
'description' => esc_html__('Check this box to enable title on single page.', 'business-lawyer-firm'),
));
$wp_customize->add_setting('business_lawyer_firm_single_page_thumb',array(
'sanitize_callback' => 'business_lawyer_firm_sanitize_checkbox',
'default' => 1,
));
$wp_customize->add_control('business_lawyer_firm_single_page_thumb',array(
'type' => 'checkbox',
'label' => esc_html__('Enable Single Page Thumbnail', 'business-lawyer-firm'),
'section' => 'business_lawyer_firm_page_settings',
'description' => esc_html__('Check this box to enable page thumbnail on single page.', 'business-lawyer-firm'),
));
// Pro Version
$wp_customize->add_setting( 'pro_version_single_page_setting', array(
'sanitize_callback' => 'Business_Lawyer_Firm_sanitize_custom_control'
));
$wp_customize->add_control( new Business_Lawyer_Firm_Customize_Pro_Version ( $wp_customize,'pro_version_single_page_setting', array(
'section' => 'business_lawyer_firm_page_settings',
'type' => 'pro_options',
'label' => esc_html__( 'Customizer Options', 'business-lawyer-firm' ),
'description' => esc_url( BUSINESS_LAWYER_FIRM_URL ),
'priority' => 100
)));
}
add_action('customize_register', 'business_lawyer_firm_customize_register');
/**
* Render the site title for the selective refresh partial.
*
* @return void
*/
function business_lawyer_firm_customize_partial_blogname(){
bloginfo('name');
}
/**
* Render the site tagline for the selective refresh partial.
*
* @return void
*/
function business_lawyer_firm_customize_partial_blogdescription(){
bloginfo('description');
}
/**
* Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
*/
function business_lawyer_firm_customize_preview_js(){
wp_enqueue_script('business-lawyer-firm-customizer', esc_url(get_template_directory_uri()) . '/assets/js/customizer.js', array('customize-preview'), '20151215', true);
}
add_action('customize_preview_init', 'business_lawyer_firm_customize_preview_js');
/*
** Load dynamic logic for the customizer controls area.
*/
function business_lawyer_firm_panels_js() {
wp_enqueue_style( 'business-lawyer-firm-customizer-layout-css', get_theme_file_uri( '/assets/css/customizer-layout.css' ) );
wp_enqueue_script( 'business-lawyer-firm-customize-layout', get_theme_file_uri( '/assets/js/customize-layout.js' ), array(), '1.2', true );
}
add_action( 'customize_controls_enqueue_scripts', 'business_lawyer_firm_panels_js' );