[2.5] If an attribute meta key is not set, technically its 'any', so should match. Prevents issues when meta data is missing after renaming attributes
@claudiosmweb please test :) #10272
This commit is contained in:
parent
628d791343
commit
a78edb2af2
|
@ -510,10 +510,18 @@ class WC_Product_Variable extends WC_Product {
|
|||
$value = wc_clean( $match_attributes[ $attribute_field_name ] );
|
||||
|
||||
$query_args['meta_query'][] = array(
|
||||
'key' => $attribute_field_name,
|
||||
'value' => array( '', $value ),
|
||||
'compare' => 'IN'
|
||||
'relation' => 'OR',
|
||||
array(
|
||||
'key' => $attribute_field_name,
|
||||
'value' => array( '', $value ),
|
||||
'compare' => 'IN'
|
||||
),
|
||||
array(
|
||||
'key' => $attribute_field_name,
|
||||
'compare' => 'NOT EXISTS'
|
||||
)
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
$matches = get_posts( $query_args );
|
||||
|
|
Loading…
Reference in New Issue