Eliminate duplicate HPOS internal meta keys (#36611)
This commit is contained in:
commit
dead6d7060
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: fix
|
||||
|
||||
Eliminate data store internal meta keys duplicates
|
|
@ -108,7 +108,15 @@ class WC_Data_Store_WP {
|
|||
* @return mixed|void
|
||||
*/
|
||||
public function filter_raw_meta_data( &$object, $raw_meta_data ) {
|
||||
$this->internal_meta_keys = array_merge( array_map( array( $this, 'prefix_key' ), $object->get_data_keys() ), $this->internal_meta_keys );
|
||||
$this->internal_meta_keys = array_unique(
|
||||
array_merge(
|
||||
array_map(
|
||||
array( $this, 'prefix_key' ),
|
||||
$object->get_data_keys()
|
||||
),
|
||||
$this->internal_meta_keys
|
||||
)
|
||||
);
|
||||
$meta_data = array_filter( $raw_meta_data, array( $this, 'exclude_internal_meta_keys' ) );
|
||||
return apply_filters( "woocommerce_data_store_wp_{$this->meta_type}_read_meta", $meta_data, $object, $this );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue