parent
8ec5986d48
commit
53c6bebbd0
|
@ -2221,7 +2221,7 @@ class WC_Admin_Post_Types {
|
|||
|
||||
if ( apply_filters( 'woocommerce_process_product_file_download_paths_grant_access_to_new_file', true, $download_id, $product_id, $order ) ) {
|
||||
// grant permission if it doesn't already exist
|
||||
if ( ! $wpdb->get_var( $wpdb->prepare( "SELECT 1 FROM {$wpdb->prefix}woocommerce_downloadable_product_permissions WHERE order_id = %d AND product_id = %d AND download_id = %s", $order->id, $product_id, $download_id ) ) ) {
|
||||
if ( ! $wpdb->get_var( $wpdb->prepare( "SELECT 1=1 FROM {$wpdb->prefix}woocommerce_downloadable_product_permissions WHERE order_id = %d AND product_id = %d AND download_id = %s", $order->id, $product_id, $download_id ) ) ) {
|
||||
wc_downloadable_file_permission( $download_id, $product_id, $order );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -134,7 +134,7 @@ $attribute_taxonomies = $wpdb->get_results( "SELECT * FROM " . $wpdb->prefix . "
|
|||
foreach ( $attribute_taxonomies as $attribute_taxonomy ) {
|
||||
$sanitized_attribute_name = wc_sanitize_taxonomy_name( $attribute_taxonomy->attribute_name );
|
||||
if ( $sanitized_attribute_name !== $attribute_taxonomy->attribute_name ) {
|
||||
if ( ! $wpdb->get_var( $wpdb->prepare( "SELECT 1 FROM {$wpdb->prefix}woocommerce_attribute_taxonomies WHERE attribute_name = %s;", $sanitized_attribute_name ) ) ) {
|
||||
if ( ! $wpdb->get_var( $wpdb->prepare( "SELECT 1=1 FROM {$wpdb->prefix}woocommerce_attribute_taxonomies WHERE attribute_name = %s;", $sanitized_attribute_name ) ) ) {
|
||||
// Update attribute
|
||||
$wpdb->update(
|
||||
"{$wpdb->prefix}woocommerce_attribute_taxonomies",
|
||||
|
|
Loading…
Reference in New Issue