Merge pull request #21333 from ediamin/conditional_check_for_float_type_product_meta
Ignore converting float meta value for registered post meta
This commit is contained in:
commit
3d2b0ab72b
|
@ -245,7 +245,7 @@ class WC_Post_Data {
|
|||
wp_cache_delete( 'product-' . $object_id, 'products' );
|
||||
}
|
||||
|
||||
if ( ! empty( $meta_value ) && is_float( $meta_value ) && in_array( get_post_type( $object_id ), array_merge( wc_get_order_types(), array( 'shop_coupon', 'product', 'product_variation' ) ), true ) ) {
|
||||
if ( ! empty( $meta_value ) && is_float( $meta_value ) && ! registered_meta_key_exists( 'post', $meta_key ) && in_array( get_post_type( $object_id ), array_merge( wc_get_order_types(), array( 'shop_coupon', 'product', 'product_variation' ) ), true ) ) {
|
||||
|
||||
// Convert float to string.
|
||||
$meta_value = wc_float_to_string( $meta_value );
|
||||
|
|
Loading…
Reference in New Issue