Browse Source

Sanitize callback

Aurorum 6 years ago
parent
commit
e53492a857
1 changed files with 6 additions and 0 deletions
  1. 6 0
      apostrophe-2/inc/customizer.php

+ 6 - 0
apostrophe-2/inc/customizer.php

@@ -15,9 +15,15 @@ function apostrophe_2_customize_register( $wp_customize ) {
 	$wp_customize->get_setting( 'blogdescription' )->transport  = 'postMessage';
 	$wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';
 	
+	function apostrophe_2_sanitize_checkbox( $checked ){ 
+            return ( ( isset( $checked ) && true == $checked ) ? true : false );
+        }
+	
 	if ( function_exists( 'jetpack_social_menu' ) ) {
 		$wp_customize->add_setting( 'apostrophe_2_mobile_social', array(
   			'capability' => 'edit_theme_options',
+			'transport' => 'refresh',
+			'sanitize_callback'  => 'apostrophe_2_sanitize_checkbox',
 		) );
 
 		$wp_customize->add_control( 'apostrophe_2_mobile_social', array(