Remove unnecessary WC()->is_rest_api_request() check

This commit is contained in:
Albert Juhé Lluveras 2024-09-17 17:40:21 +02:00
parent 2b24c07a8e
commit c6991115c8
1 changed files with 1 additions and 1 deletions

View File

@ -327,7 +327,7 @@ class CustomizeStore extends Task {
* @return array An array of post objects, potentially including sample products. * @return array An array of post objects, potentially including sample products.
*/ */
public function add_sample_products_to_query( $posts, $query ) { public function add_sample_products_to_query( $posts, $query ) {
if ( 'product' !== $query->query['post_type'] || ! WC()->is_rest_api_request() || ! empty( $posts ) ) { if ( 'product' !== $query->query['post_type'] || ! empty( $posts ) ) {
return $posts; return $posts;
} }