From 5e448c082ef88dfecdf0cbd7f903b69b4039f021 Mon Sep 17 00:00:00 2001 From: savvasha Date: Wed, 20 Apr 2022 17:42:13 +0300 Subject: [PATCH] FIX: If input value is empty, 0 is saved instead insteaf of default value. --- includes/sp-core-functions.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/sp-core-functions.php b/includes/sp-core-functions.php index 21f52b86..e7fa7f75 100644 --- a/includes/sp-core-functions.php +++ b/includes/sp-core-functions.php @@ -367,7 +367,11 @@ if ( ! function_exists( 'sp_array_value' ) ) { else : switch ( $sanitize ) : case 'int': - $value = intval( $value ); + if ( empty( $value ) ) { + $value = $value; + }else{ + $value = intval( $value ); + } break; case 'title': $value = sanitize_title( $value );