From 719a58c6574477865fd941e6e692132c0a8956a6 Mon Sep 17 00:00:00 2001 From: Felipe Elia Date: Tue, 3 Oct 2023 16:45:59 -0300 Subject: [PATCH 1/2] Make sure post_status is always passed as an array --- includes/classes/Indexable/Post/Post.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/classes/Indexable/Post/Post.php b/includes/classes/Indexable/Post/Post.php index 717b26598f..5eece6821d 100644 --- a/includes/classes/Indexable/Post/Post.php +++ b/includes/classes/Indexable/Post/Post.php @@ -2268,7 +2268,7 @@ protected function parse_post_status( $args ) { return [ $terms_map_name => [ - 'post_status' => $post_status, + 'post_status' => array_values( $post_status ), ], ]; } From 7706d3a33cb11a949577b9af4888616d9198e5c9 Mon Sep 17 00:00:00 2001 From: Felipe Elia Date: Wed, 4 Oct 2023 13:09:24 -0300 Subject: [PATCH 2/2] Only use array_values if is array --- includes/classes/Indexable/Post/Post.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/classes/Indexable/Post/Post.php b/includes/classes/Indexable/Post/Post.php index 5eece6821d..55475f04ca 100644 --- a/includes/classes/Indexable/Post/Post.php +++ b/includes/classes/Indexable/Post/Post.php @@ -2268,7 +2268,7 @@ protected function parse_post_status( $args ) { return [ $terms_map_name => [ - 'post_status' => array_values( $post_status ), + 'post_status' => is_array( $post_status ) ? array_values( $post_status ) : $post_status, ], ]; }