get_setting( 'header_textcolor' )->transport = 'refresh';
$wp_customize->remove_control('header_textcolor');
$wp_customize->get_setting( 'header_image' )->transport = 'refresh';
$wp_customize->get_section( 'header_image' )->description = "The big-bob theme is designed to maximize the size of any header image
or header video while minimizing distortion regardless of the screen size or the header media's dimensions.
You should feel free to utilize horizontally or vertically or squarely defined images or videos.
If you choose both an image and a video, the image will load first then the video will replace it. Header media is only displayed
on your homepage.";
$wp_customize->get_setting( 'header_video' )->transport = 'refresh';
$wp_customize->get_setting( 'custom_logo' )->transport = 'refresh';
$wp_customize->get_control( 'display_header_text' )->description = 'The title and tagline will always be displayed in the navbar
whenever a logo is not used, and this checkbox does nothing.
However if you use a logo, then this checkbox can be used to add a title and tagline to the middle
of the screen.';
$wp_customize->get_control( 'background_color' )->description = 'The background color will only be displayed if there is no background image.
This is also a good tool to use to test the readability of your link color in front of a variety of colors. Dark background colors tend
to be the most versatile.';
$wp_customize->get_section('background_image')->description = "The Background Copy must be tunred OFF if you want to see the
background image in its normal format.";
$wp_customize->remove_control( 'external_header_video' );
$wp_customize->get_setting('background_image')->transport = 'refresh';
$wp_customize->add_setting('big_bob_link_color', array(
'default' => '#66cdaa',
'transport' => 'postMessage',
'sanitize_callback' => 'sanitize_hex_color_no_hash',
));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'big_bob_link_color', array(
'label' => 'Link Color',
'section' => 'colors',
'settings' => 'big_bob_link_color',
'priority' => -1,
'description' => 'This will change the color of all the links, but while using the customizer, the only link color that you will
see change are the links that are visible on the active screen, however all the links will be updated when you publish.
You can use the background color control to test the readability of your link color. Bright link colors tend to be the most versatile.
If you want to change any other colors, you can use the Additional CSS Section,
but this is not recommended because it will likely have a negative impact on readability.',
)));
$wp_customize->add_section('big_bob_header_media_options', array(
'title' => 'Header Media Options',
'priority' => 79,
));
$wp_customize->add_setting('big_bob_media_to_background', array(
'default' => 'Off',
'transport' => 'postMessage',
'sanitize_callback' => 'big_bob_checkMediaFit',
));
$wp_customize->add_control('big_bob_media_to_background', array(
'label' => 'Set Header Media to Background',
'section' => 'big_bob_header_media_options',
'settings' => 'big_bob_media_to_background',
'type' => 'radio',
'choices' => array(
'On' => 'On',
'Off' => 'Off',
),
'priority' => 0,
'description' => 'Turning this on will cause the header media to stay in place and the text to scroll over the top of the media.',
));
$wp_customize->selective_refresh->add_partial( 'big_bob_media_to_background', array(
'render_callback' => 'big_bob_media_in_background',
) );
$wp_customize->add_setting('big_bob_video_on_phone', array(
'default' => 'On',
'transport' => 'postMessage',
'sanitize_callback' => 'big_bob_checkMediaFit',
));
$wp_customize->add_control('big_bob_video_on_phone', array(
'label' => 'Show Header Video On Mobile',
'section' => 'big_bob_header_media_options',
'settings' => 'big_bob_video_on_phone',
'type' => 'radio',
'choices' => array(
'On' => 'On',
'Off' => 'Off',
),
'priority' => 0,
'description' => 'Turns off the video for mobile devices with small screen sizes (a width of less than 1050 pixels).
The item loaded (image or video) is based on the width when the site loads.',
));
$wp_customize->add_setting('big_bob_background_copy', array(
'default' => 'On',
'transport' => 'refresh',
'sanitize_callback' => 'big_bob_checkMediaFit',
));
$wp_customize->add_control('big_bob_background_copy', array(
'label' => 'Background Copy',
'section' => 'background_image',
'settings' => 'big_bob_background_copy',
'type' => 'radio',
'choices' => array(
'On' => 'On',
'Off' => 'Off',
),
'priority' => 0,
'description' => 'This sets a copy of your background image that is centered on your screen in a fixed position
on your feed pages (like your posts page). This also turns off your main background image.',
));
$wp_customize->selective_refresh->add_partial( 'big_bob_background_copy', array(
'render_callback' => 'big_bob_remove_main_background',
) );
$wp_customize->selective_refresh->add_partial( 'big_bob_video_on_phone', array(
'render_callback' => 'big_bob_video_for_phone',
) );
$wp_customize->add_section('big_bob_navigation', array(
'title' => 'Sticky Sidebar',
'priority' => 101,
));
$wp_customize->add_setting('big_bob_sticky_sidebar', array(
'default' => 'Off',
'transport' => 'postMessage',
'sanitize_callback' => 'big_bob_checkMediaFit',
));
$wp_customize->add_control('big_bob_sticky_sidebar', array(
'label' => 'Sticky Sidebar',
'section' => 'big_bob_navigation',
'settings' => 'big_bob_sticky_sidebar',
'type' => 'radio',
'choices' => array(
'On' => 'On',
'Off' => 'Off',
),
'priority' => 0,
'description' => 'If a sidebar is being used then turning this on will cause the sidebar to shrink in size if it is big
and become its own window with its own scrollbar, and it will stick into position when you scroll down the screen.',
));
$wp_customize->selective_refresh->add_partial( 'big_bob_sticky_sidebar', array(
'render_callback' => 'big_bob_sidebar_is_sticky',
) );
}
add_action( 'customize_register', 'big_bob_customize_register' );
/**
* Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
*/
function big_bob_customize_preview_js() {
wp_enqueue_script( 'big-bob-customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20151215', true );
}
add_action( 'customize_preview_init', 'big_bob_customize_preview_js' );
add_action('wp_head', 'big_bob_customizer_css');
function big_bob_customizer_css()
{
?>
'On',
'Off' => 'Off',
);
if (array_key_exists($input, $valid)) {
return $input;
} else {
return '';
}
}