on_off_label = $args['on_off_label'];
parent::__construct( $manager, $id, $args );
}
public function render_content(){
?>
label ); ?>
description ){ ?>
description ); ?>
value() == 'true' ) ? 'switch-on' : '';
$on_off_label = $this->on_off_label;
?>
link(); ?> type="hidden" value="value() ); ?>"/>
choices ) )
return;
?>
taxonomy = esc_attr( $taxonomy );
parent::__construct( $manager, $id, $args );
}
public function render_content() {
$tax_args = array(
'hierarchical' => 0,
'taxonomy' => $this->taxonomy,
);
$taxonomies = get_categories( $tax_args );
?>
remove_section( 'colors' );
$wp_customize->add_setting( 'blog_foodie_topbar_number', array(
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control( 'blog_foodie_topbar_number', array(
'label' => esc_html__( 'Phone Number', 'blog-foodie' ),
'section' => 'vivid_blog_topbar_section',
'type' => 'text',
) );
$wp_customize->add_setting( 'blog_foodie_topbar_email', array(
'sanitize_callback' => 'sanitize_email',
) );
$wp_customize->add_control( 'blog_foodie_topbar_email', array(
'label' => esc_html__( 'Email', 'blog-foodie' ),
'section' => 'vivid_blog_topbar_section',
'type' => 'email',
) );
$wp_customize->add_setting( 'blog_foodie_topbar_address', array(
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control( 'blog_foodie_topbar_address', array(
'label' => esc_html__( 'Address', 'blog-foodie' ),
'section' => 'vivid_blog_topbar_section',
'type' => 'text',
) );
// Add gallery section
$wp_customize->add_section( 'vivid_blog_gallery_section', array(
'title' => esc_html__( 'Gallery','blog-foodie' ),
'description' => esc_html__( 'Gallery Section options.', 'blog-foodie' ),
'panel' => 'vivid_blog_front_page_panel',
'priority' => 22,
) );
// gallery content enable control and setting
$wp_customize->add_setting( 'blog_foodie_gallery_section_enable', array(
'sanitize_callback' => 'vivid_blog_sanitize_switch_control',
) );
$wp_customize->add_control( new Blog_Foodie_Switch_Control( $wp_customize, 'blog_foodie_gallery_section_enable', array(
'label' => esc_html__( 'Gallery Enable', 'blog-foodie' ),
'section' => 'vivid_blog_gallery_section',
'on_off_label' => vivid_blog_switch_options(),
) ) );
$wp_customize->add_setting( 'blog_foodie_gallery_section_category', array(
'sanitize_callback' => 'vivid_blog_sanitize_single_category',
) ) ;
$wp_customize->add_control( new Blog_Foodie_Dropdown_Taxonomies_Control( $wp_customize,'blog_foodie_gallery_section_category', array(
'label' => esc_html__( 'Select Category', 'blog-foodie' ),
'description' => esc_html__( 'Note: Latest six posts will be shown from selected category', 'blog-foodie' ),
'section' => 'vivid_blog_gallery_section',
'type' => 'dropdown-taxonomies',
'active_callback' => 'blog_foodie_is_gallery_section_enable'
) ) );
// Add cta section
$wp_customize->add_section( 'vivid_blog_cta_section', array(
'title' => esc_html__( 'Cta','blog-foodie' ),
'description' => esc_html__( 'Cta Section options.', 'blog-foodie' ),
'panel' => 'vivid_blog_front_page_panel',
'priority' => 21,
) );
// cta content enable control and setting
$wp_customize->add_setting( 'blog_foodie_cta_section_enable', array(
'sanitize_callback' => 'vivid_blog_sanitize_switch_control',
) );
$wp_customize->add_control( new Blog_Foodie_Switch_Control( $wp_customize, 'blog_foodie_cta_section_enable', array(
'label' => esc_html__( 'Cta Enable', 'blog-foodie' ),
'section' => 'vivid_blog_cta_section',
'on_off_label' => vivid_blog_switch_options(),
) ) );
// cta sub_title setting and control
$wp_customize->add_setting( 'blog_foodie_cta_section_sub_title', array(
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control( 'blog_foodie_cta_section_sub_title', array(
'label' => esc_html__( 'Section Sub Title ', 'blog-foodie' ),
'section' => 'vivid_blog_cta_section',
'active_callback' => 'blog_foodie_is_cta_section_enable',
'type' => 'text',
) );
$wp_customize->add_setting( 'blog_foodie_cta_section_show_more_label', array(
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control( 'blog_foodie_cta_section_show_more_label', array(
'label' => esc_html__( 'Section Show More Label', 'blog-foodie' ),
'section' => 'vivid_blog_cta_section',
'active_callback' => 'blog_foodie_is_cta_section_enable',
'type' => 'text',
) );
$wp_customize->add_setting( 'blog_foodie_cta_content_page', array(
'sanitize_callback' => 'vivid_blog_sanitize_page',
) );
$wp_customize->add_control( new Blog_Foodie_Dropdown_Chooser( $wp_customize, 'blog_foodie_cta_content_page', array(
'label' => esc_html__( 'Select Page', 'blog-foodie' ),
'section' => 'vivid_blog_cta_section',
'choices' => vivid_blog_page_choices(),
'active_callback' => 'blog_foodie_is_cta_section_enable',
) ) );
// Add quote section
$wp_customize->add_section( 'vivid_blog_quote_section', array(
'title' => esc_html__( 'Quote','blog-foodie' ),
'description' => esc_html__( 'Quote Section options.', 'blog-foodie' ),
'panel' => 'vivid_blog_front_page_panel',
'priority' => 35,
) );
// quote content enable control and setting
$wp_customize->add_setting( 'blog_foodie_quote_section_enable', array(
'sanitize_callback' => 'vivid_blog_sanitize_switch_control',
) );
$wp_customize->add_control( new Blog_Foodie_Switch_Control( $wp_customize, 'blog_foodie_quote_section_enable', array(
'label' => esc_html__( 'Quote Enable', 'blog-foodie' ),
'section' => 'vivid_blog_quote_section',
'on_off_label' => vivid_blog_switch_options(),
) ) );
// quote sub_title setting and control
$wp_customize->add_setting( 'blog_foodie_quote_section_sub_title', array(
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control( 'blog_foodie_quote_section_sub_title', array(
'label' => esc_html__( 'Section Sub Title ', 'blog-foodie' ),
'section' => 'vivid_blog_quote_section',
'active_callback' => 'blog_foodie_is_quote_section_enable',
'type' => 'text',
) );
$wp_customize->add_setting( 'blog_foodie_quote_bg_image', array(
'sanitize_callback' => 'vivid_blog_sanitize_image'
) );
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'blog_foodie_quote_bg_image',
array(
'label' => esc_html__( 'BG Image', 'blog-foodie' ),
'active_callback' => 'blog_foodie_is_quote_section_enable',
'section' => 'vivid_blog_quote_section',
) ) );
$wp_customize->add_setting( 'blog_foodie_quote_content_page', array(
'sanitize_callback' => 'vivid_blog_sanitize_page',
) );
$wp_customize->add_control( new Blog_Foodie_Dropdown_Chooser( $wp_customize, 'blog_foodie_quote_content_page', array(
'label' => esc_html__( 'Select Page', 'blog-foodie' ),
'section' => 'vivid_blog_quote_section',
'choices' => vivid_blog_page_choices(),
'active_callback' => 'blog_foodie_is_quote_section_enable',
) ) );
}
add_action( 'customize_register', 'blog_foodie_customize_register' );
function blog_foodie_is_gallery_section_enable( $control ) {
return ( $control->manager->get_setting( 'blog_foodie_gallery_section_enable' )->value() );
}
function blog_foodie_is_cta_section_enable( $control ) {
return ( $control->manager->get_setting( 'blog_foodie_cta_section_enable' )->value() );
}
function blog_foodie_is_quote_section_enable( $control ) {
return ( $control->manager->get_setting( 'blog_foodie_quote_section_enable' )->value() );
}