I am having a problem with the WordPress Customizer checkbox default value.
No matter what I put in the default value, but the checkbox is always checked in the theme customizer.
$wp_customize->add_setting( 'swastika_social_youtube', array(
'capability' => 'edit_theme_options',
'default' => 'false',
'sanitize_callback' => 'swastika_sanitize_checkbox',
)
);
$wp_customize->add_control( 'swastika_social_youtube', array(
'type' => 'checkbox',
'section' => 'social_settings_section',
'label' => __( 'Show Youtube Icon', 'swastika' ),
)
);
And here is how I am showing icon
<?php if ( true == get_theme_mod( 'swastika_social_youtube', false ) ) { ?>
<a href="#"><i class="fa fa-youtube-play" aria-hidden="true"></i></a>
<?php } ?>
Please Help Me