Merge pull request #18618 from woocommerce/fix/18613
Cast min, max, and value to int
This commit is contained in:
commit
1627cbd8eb
|
@ -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(
|
||||||
|
|
Loading…
Reference in New Issue