Catalog rows: cast min, max, and value to int

This commit is contained in:
Anh Hoang Nguyen 2018-02-06 14:50:23 +07:00 committed by GitHub
parent 63f95a4498
commit 0ec546427e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -154,8 +154,10 @@ class WC_Shop_Customizer {
wp.customize( 'woocommerce_catalog_rows', function( setting ) {
setting.bind( function( value ) {
var min = '<?php echo esc_js( $min_rows ); ?>';
var max = '<?php echo esc_js( $max_rows ); ?>';
var min = parseInt( '<?php echo esc_js( $min_rows ); ?>', 10 );
var max = parseInt( '<?php echo esc_js( $max_rows ); ?>', 10 );
value = parseInt( value, 10 );
if ( max && value > max ) {
setting.notifications.add( 'max_rows_error', new wp.customize.Notification(