From 3f5aed6e449963cee6be54a1d5de9390a4276626 Mon Sep 17 00:00:00 2001 From: Luigi Teschio Date: Thu, 4 May 2023 14:21:20 +0200 Subject: [PATCH] Single Product Template - Related Products: fix items per page option (#9286) --- src/BlockTypes/RelatedProducts.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/BlockTypes/RelatedProducts.php b/src/BlockTypes/RelatedProducts.php index ff3d833a54b..4a141ccc6a3 100644 --- a/src/BlockTypes/RelatedProducts.php +++ b/src/BlockTypes/RelatedProducts.php @@ -93,9 +93,10 @@ public function build_query( $query ) { } return array( - 'post_type' => 'product', - 'post__in' => $related_products_ids, - 'post_status' => 'publish', + 'post_type' => 'product', + 'post__in' => $related_products_ids, + 'post_status' => 'publish', + 'posts_per_page' => $query['posts_per_page'], ); }