Skip to content
This repository has been archived by the owner on Feb 17, 2025. It is now read-only.

Commit

Permalink
text change, used wp sanitize callback
Browse files Browse the repository at this point in the history
  • Loading branch information
MaggieCabrera authored and scruffian committed Feb 2, 2022
1 parent 5c012a8 commit e97c1ca
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions blockbase/inc/customizer/wp-customize-colors.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ function register_duotone_controls( $wp_customize ) {
array(
'default' => true,
'capability' => 'edit_theme_options',
'sanitize_callback' => array( __CLASS__, 'sanitize_boolean' ),
'sanitize_callback' => 'rest_sanitize_boolean',
'transport' => 'postMessage', // We need this to stop the page refreshing.
)
);
Expand All @@ -153,7 +153,7 @@ function register_duotone_controls( $wp_customize ) {
array(
'type' => 'checkbox',
'section' => $this->section_key,
'label' => __( 'Apply these colors to the theme\'s images', 'blockbase' ),
'label' => __( 'Enable duotone', 'blockbase' ),
)
);

Expand Down Expand Up @@ -312,17 +312,6 @@ function check_if_colors_are_default() {
return true;
}

/*
* Sanitize a boolean value
*/
function sanitize_boolean( $input ) {
if ( is_bool( $input ) ) {
return $input;
} else {
return true;
}
}

}

new GlobalStylesColorCustomizer;

0 comments on commit e97c1ca

Please sign in to comment.