From 2ac95cbe6312b82a9380730ac457bf0a4e02153b Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sun, 1 Mar 2020 09:49:40 -0500 Subject: [PATCH] *Don't use empty check --- includes/class-wc-product-tables-backwards-compatibility.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/class-wc-product-tables-backwards-compatibility.php b/includes/class-wc-product-tables-backwards-compatibility.php index e79ab82..8bf741b 100644 --- a/includes/class-wc-product-tables-backwards-compatibility.php +++ b/includes/class-wc-product-tables-backwards-compatibility.php @@ -200,7 +200,7 @@ public static function get_from_product_table( $args ) { $data = array(); } - if ( empty( $data[ $args['column'] ] ) ) { + if ( ! isset( $data[ $args['column'] ] ) ) { $escaped_column = '`' . esc_sql( $args['column'] ) . '`'; $data[ $args['column'] ] = $wpdb->get_col( $wpdb->prepare( @@ -311,7 +311,7 @@ public static function get_from_relationship_table( $args ) { $data = wp_cache_get( 'woocommerce_product_backwards_compatibility_' . $args['type'] . '_relationship_' . $args['product_id'], 'product' ); - if ( empty( $data ) ) { + if ( false === $data ) { $data = array( array( $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT object_id from {$wpdb->prefix}wc_product_relationships WHERE product_id = %d AND type = %s", $args['product_id'], $args['type'] ) ),