Merge pull request #18618 from woocommerce/fix/18613

Cast min, max, and value to int
This commit is contained in:
Claudiu Lodromanean 2018-01-26 07:58:30 -08:00 committed by GitHub
commit 1627cbd8eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -121,8 +121,10 @@ class WC_Shop_Customizer {
wp.customize( 'woocommerce_catalog_columns', function( setting ) { wp.customize( 'woocommerce_catalog_columns', function( setting ) {
setting.bind( function( value ) { setting.bind( function( value ) {
var min = '<?php echo esc_js( $min_columns ); ?>'; var min = parseInt( '<?php echo esc_js( $min_columns ); ?>', 10 );
var max = '<?php echo esc_js( $max_columns ); ?>'; var max = parseInt( '<?php echo esc_js( $max_columns ); ?>', 10 );
value = parseInt( value, 10 );
if ( max && value > max ) { if ( max && value > max ) {
setting.notifications.add( 'max_columns_error', new wp.customize.Notification( setting.notifications.add( 'max_columns_error', new wp.customize.Notification(