add_section('blockwp_footer_section', array(
'capability' => 'edit_theme_options',
'theme_supports' => '',
'title' => __('Footer Options', 'blockwp'),
'panel' => 'blockwp_panel',
));
/*Enable Logo Option*/
$wp_customize->add_setting(
'blockwp_footer_logo_option',
array(
'capability' => 'edit_theme_options',
'transport' => 'refresh',
'default' => 0,
'sanitize_callback' => 'blockwp_sanitize_checkbox',
)
);
$wp_customize->add_control(
'blockwp_footer_logo_option',
array(
'label' => __('Enable Logo in Footer', 'blockwp'),
'description' => __('Checked to show the logo in footer. More options available in pro version.', 'blockwp'),
'section' => 'blockwp_footer_section',
'type' => 'checkbox',
)
);
/*callback functions footer Logo*/
if (!function_exists('blockwp_footer_logo_callback')) :
function blockwp_footer_logo_callback()
{
$featured = absint(get_theme_mod('blockwp_footer_logo_option', 0));
if (1 == $featured) {
return true;
} else {
return false;
}
}
endif;
/*Add Logo in Footer*/
$wp_customize->add_setting(
'blockwp_footer_logo_image',
array(
'capability' => 'edit_theme_options',
'transport' => 'refresh',
'default' => '',
'sanitize_callback' => 'blockwp_sanitize_image',
)
);
$wp_customize->add_control(
new WP_Customize_Image_Control(
$wp_customize,
'blockwp_footer_logo_image',
array(
'label' => __('Upload Logo for Footer', 'blockwp'),
'description' => __('You can add the logo here in footer as well.', 'blockwp'),
'section' => 'blockwp_footer_section',
'type' => 'image',
'active_callback'=> 'blockwp_footer_logo_callback',
)
)
);
/*Enable Social Icons in Footer*/
$wp_customize->add_setting(
'blockwp_enable_social_menu_footer',
array(
'capability' => 'edit_theme_options',
'transport' => 'refresh',
'default' => 0,
'sanitize_callback' => 'blockwp_sanitize_checkbox',
)
);
$wp_customize->add_control(
'blockwp_enable_social_menu_footer',
array(
'label' => __('Enable Social Icons', 'blockwp'),
'description' => sprintf(
'%1$s %3$s %4$s',
__('Top menu will enabled from here. Go to', 'blockwp'),
esc_url(admin_url('/customize.php?')),
__('Customize > Menus', 'blockwp'),
__('and make a new menu for social icons using custom links.', 'blockwp')
),
'section' => 'blockwp_footer_section',
'type' => 'checkbox',
)
);
/*Enable Menu at the footer*/
$wp_customize->add_setting(
'blockwp_enable_footer_menu',
array(
'capability' => 'edit_theme_options',
'transport' => 'refresh',
'default' => 1,
'sanitize_callback' => 'blockwp_sanitize_checkbox',
)
);
$wp_customize->add_control(
'blockwp_enable_footer_menu',
array(
'label' => __('Enable Footer Menu', 'blockwp'),
'description' => sprintf(
'%1$s %3$s %4$s',
__('Top menu will enabled from here. Go to', 'blockwp'),
esc_url(admin_url('/customize.php?')),
__('Customize > Menus', 'blockwp'),
__('and make a new menu for footer section.', 'blockwp')
),
'section' => 'blockwp_footer_section',
'type' => 'checkbox',
)
);
/*Footer Copyright*/
$wp_customize->add_setting(
'blockwp_footer_copyright_text',
array(
'capability' => 'edit_theme_options',
'transport' => 'refresh',
'default' => __('Copyright All Rights Reserved', 'blockwp'),
'sanitize_callback' => 'sanitize_text_field',
)
);
$wp_customize->add_control(
'blockwp_footer_copyright_text',
array(
'label' => __('Copyright Text', 'blockwp'),
'description' => __('Your own footer copyright text goes here.', 'blockwp'),
'section' => 'blockwp_footer_section',
'type' => 'text',
)
);
/*Enable Go to the top Option*/
$wp_customize->add_setting(
'blockwp_footer_to_top_option',
array(
'capability' => 'edit_theme_options',
'transport' => 'refresh',
'default' => 1,
'sanitize_callback' => 'blockwp_sanitize_checkbox',
)
);
$wp_customize->add_control(
'blockwp_footer_to_top_option',
array(
'label' => __('Enable Go to the Top', 'blockwp'),
'description' => __('Checked to enable the icon go to the top in the footer.', 'blockwp'),
'section' => 'blockwp_footer_section',
'type' => 'checkbox',
)
);
/*Footer search or text option*/
$wp_customize->add_setting(
'blockwp_footer_search_or_text_option',
array(
'capability' => 'edit_theme_options',
'transport' => 'refresh',
'default' => 'search',
'sanitize_callback' => 'blockwp_sanitize_select'
)
);
$wp_customize->add_control(
'blockwp_footer_search_or_text_option',
array(
'choices' => array(
'text' => __('Enable Text with Custom Link Support', 'blockwp'),
'search' => __('Enable Search Bar', 'blockwp'),
'hide' => __('Hide both Text and Search', 'blockwp'),
),
'label' => __('Display custom text or search bar', 'blockwp'),
'description' => __('You can either add the text with link or search bar.', 'blockwp'),
'section' => 'blockwp_footer_section',
'settings' => 'blockwp_footer_search_or_text_option',
'type' => 'select',
)
);
/*callback functions for footer text and search*/
if (!function_exists('blockwp_footer_text_search')) :
function blockwp_footer_text_search()
{
$custom_text = esc_attr(get_theme_mod('blockwp_footer_search_or_text_option', 'Candid Themes with powerful themes and plugins.'));
if ('text' == $custom_text) {
return true;
} else {
return false;
}
}
endif;
/*Footer Custom text with link*/
$wp_customize->add_setting(
'blockwp_footer_custom_text',
array(
'capability' => 'edit_theme_options',
'transport' => 'refresh',
'default' => __('Candid Themes with powerful themes and plugins.', 'blockwp'),
'sanitize_callback' => 'wp_kses_post',
)
);
$wp_customize->add_control(
'blockwp_footer_custom_text',
array(
'label' => __('Custom Text and Links Support', 'blockwp'),
'description' => __('You can use HTML tags here to link.', 'blockwp'),
'section' => 'blockwp_footer_section',
'type' => 'textarea',
'active_callback'=> 'blockwp_footer_text_search'
)
);