Merge pull request #24385 from woocommerce/fix/24356
Ensure WC_Product_Data_Store_CPT::is_existing_sku() return boolean
This commit is contained in:
commit
c3262eea3e
|
@ -949,7 +949,7 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
|
|||
global $wpdb;
|
||||
|
||||
// phpcs:ignore WordPress.VIP.DirectDatabaseQuery.DirectQuery
|
||||
return $wpdb->get_var(
|
||||
return (bool) $wpdb->get_var(
|
||||
$wpdb->prepare(
|
||||
"
|
||||
SELECT posts.ID
|
||||
|
@ -1088,7 +1088,7 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
|
|||
|
||||
$query .= ' AND postmeta.meta_key IN ( "' . implode( '","', array_map( 'esc_sql', $meta_attribute_names ) ) . '" )';
|
||||
|
||||
$query.=' ORDER BY posts.menu_order ASC, postmeta.post_id ASC;';
|
||||
$query .= ' ORDER BY posts.menu_order ASC, postmeta.post_id ASC;';
|
||||
|
||||
$attributes = $wpdb->get_results( $query ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
|
||||
|
||||
|
|
Loading…
Reference in New Issue