File: /home/petsclubcc/LinkersIT.com/wp-content/themes/toka/classes/class-theme-customize.php
<?php
/**
* Customizer settings for this theme.
* @since Toka 1.0
*/
if (!class_exists('toka_Customize')) {
/**
* CUSTOMIZER SETTINGS
*/
class toka_Customize
{
/**
* Register customizer options.
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
*/
public static function register($wp_customize)
{
/* ========================================================================= */
/*
* COLORS
*/
// Primary color
$wp_customize->add_setting('pr_color', array(
'default' => '#36bb91',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color'
));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'pr_color', array(
'section' => 'colors',
'label' => esc_html__('Primary color', 'toka'),
'description' => esc_html__('Sets main accent color.', 'toka'),
)));
// Primary links hover color
$wp_customize->add_setting('pr_links_h_color', array(
'default' => '#36bb91',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color'
));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'pr_links_h_color', array(
'section' => 'colors',
'label' => esc_html__('Primary hover color', 'toka'),
'description' => esc_html__('Sets link hover color.', 'toka'),
)));
// Primary background color
$wp_customize->add_setting('pr_bg_color', array(
'default' => '#1c222b',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color'
));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'pr_bg_color', array(
'section' => 'colors',
'label' => esc_html__('Primary background color', 'toka'),
'description' => esc_html__("Changes accent background color.", 'toka'),
)));
// Header background color
$wp_customize->add_setting('h_bg_color', array(
'default' => '#1c222b',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color'
));
// Footer background color
$wp_customize->add_setting('f_bg_color', array(
'default' => '#f8f8f8',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color'
));
// Primary dark color
$wp_customize->add_setting('pr_d_color', array(
'default' => '#b6bdc5',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color'
));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'pr_d_color', array(
'section' => 'colors',
'label' => esc_html__('Primary dark color', 'toka'),
'description' => esc_html__('Sets text color in paragraphs.', 'toka'),
)));
// h1 title color
$wp_customize->add_setting('title_color', array(
'default' => '#ffffff',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color'
));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'title_color', array(
'section' => 'colors',
'label' => esc_html__('Title color', 'toka'),
'description' => esc_html__('Sets color for titles.', 'toka'),
)));
// Footer widget title color
$wp_customize->add_setting('fw_title_color', array(
'default' => '#1a1a1a',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color'
));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'fw_title_color', array(
'section' => 'colors',
'label' => esc_html__('Footer widget title color', 'toka'),
)));
// Button background color
$wp_customize->add_setting('btn_bg_color', array(
'default' => '#36bb91',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color'
));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'btn_bg_color', array(
'section' => 'colors',
'label' => esc_html__('Button background color', 'toka'),
)));
// Button hover color
$wp_customize->add_setting('btn_h_color', array(
'default' => '#1a5e49',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color'
));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'btn_h_color', array(
'section' => 'colors',
'label' => esc_html__('Button hover color', 'toka'),
)));
// Text selection background color
$wp_customize->add_setting('txt_select_bg_color', array(
'default' => '#f3d7f463',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color'
));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'txt_select_bg_color', array(
'section' => 'colors',
'label' => esc_html__('Text selection background color', 'toka'),
'description' => esc_html__('Changes text selection background color. Try to select text on a page.', 'toka'),
)));
/* end COLORS */
/* ========================================================================= */
/*
* HEADER
*/
$wp_customize->add_section('header', array(
'title' => esc_html__('Header', 'toka')
));
// Enable CTA button in the header
$wp_customize->add_setting('h_cta_btn_switcher', array(
'default' => false,
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('h_cta_btn_switcher', array(
'section' => 'header',
'label' => esc_html__('Enable CTA button (call-to-action).', 'toka'),
'type' => 'checkbox'
));
// Header CTA button link
$wp_customize->add_setting('h_cta_btn_link', array(
'default' => esc_html__('/contact-us', 'toka'),
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('h_cta_btn_link', array(
'section' => 'header',
'label' => esc_html__('CTA button link:', 'toka'),
'type' => 'text'
));
// Header CTA button text
$wp_customize->add_setting('h_cta_btn_txt', array(
'default' => esc_html__('Buy Now', 'toka'),
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('h_cta_btn_txt', array(
'section' => 'header',
'label' => esc_html__('CTA button text:', 'toka'),
'type' => 'text'
));
// Sticky header
$wp_customize->add_setting('sticky_header_switcher', array(
'default' => false,
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('sticky_header_switcher', array(
'section' => 'header',
'label' => esc_html__('Sticky header', 'toka'),
'type' => 'checkbox'
));
// Change logo height
$wp_customize->add_setting('logo_height', array(
'default' => '40',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('logo_height', array(
'section' => 'header',
'label' => esc_html__('Logo height:', 'toka'),
'type' => 'number'
));
/* end HEADER */
/* ========================================================================= */
/*
* FOOTER
*/
$wp_customize->add_section('footer', array(
'title' => esc_html__('Footer', 'toka')
));
// Switcher for Copyright text
$wp_customize->add_setting('copyright_text_switcher', array(
'default' => false,
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('copyright_text_switcher', array(
'section' => 'footer',
'label' => esc_html__('Disable "Copyright" text before the year', 'toka'),
'type' => 'checkbox'
));
// Custom copyright
$wp_customize->add_setting('copyright_text', array(
'default' => '',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('copyright_text', array(
'section' => 'footer',
'label' => esc_html__('Custom copyright text.', 'toka'),
'description' => esc_html__('Leave blank to use default copyright.', 'toka'),
'type' => 'text'
));
/* end FOOTER */
/* ========================================================================= */
/*
* TWEAKS
*/
$wp_customize->add_section('tweaks', array(
'title' => esc_html__('Tweaks', 'toka')
));
// Disable post category meta text
$wp_customize->add_setting('meta_cat_switcher', array(
'default' => false,
'transport' => 'postMessage',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('meta_cat_switcher', array(
'section' => 'tweaks',
'label' => esc_html__('Disable post category meta text', 'toka'),
'type' => 'checkbox'
));
// Disable date meta text
$wp_customize->add_setting('meta_date_switcher', array(
'default' => false,
'transport' => 'postMessage',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('meta_date_switcher', array(
'section' => 'tweaks',
'label' => esc_html__('Disable date meta text', 'toka'),
'type' => 'checkbox'
));
// Disable post author meta text
$wp_customize->add_setting('meta_author_switcher', array(
'default' => false,
'transport' => 'postMessage',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('meta_author_switcher', array(
'section' => 'tweaks',
'label' => esc_html__('Disable post author meta text', 'toka'),
'type' => 'checkbox'
));
// Disable post comments meta text
$wp_customize->add_setting('meta_comm_switcher', array(
'default' => false,
'transport' => 'postMessage',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('meta_comm_switcher', array(
'section' => 'tweaks',
'label' => esc_html__('Disable post comments meta text', 'toka'),
'type' => 'checkbox'
));
// Disable icon before title
$wp_customize->add_setting('icon_before_title_switcher', array(
'default' => false,
'transport' => 'postMessage',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('icon_before_title_switcher', array(
'section' => 'tweaks',
'label' => esc_html__('Disable icon before title', 'toka'),
'type' => 'checkbox'
));
/* end TWEAKS */
/* ========================================================================= */
/* -----------------------------*/
/* end Customize Settings */
/* -----------------------------*/
}
}
// Setup the Theme Customizer settings and controls.
add_action('customize_register', array('toka_Customize', 'register'));
}