From a14c77dc3a8444b52e18f137bbc2fe9e54d32dd4 Mon Sep 17 00:00:00 2001 From: Rebecca Hum <16962021+rebeccahum@users.noreply.github.com> Date: Mon, 7 Feb 2022 10:25:15 -0700 Subject: [PATCH 1/2] get_total_objects_for_query_from_db: bail if we have lower or upper limits set --- includes/classes/Indexable/Post/Post.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/classes/Indexable/Post/Post.php b/includes/classes/Indexable/Post/Post.php index cf7c3fedbd..f2dc42b84c 100644 --- a/includes/classes/Indexable/Post/Post.php +++ b/includes/classes/Indexable/Post/Post.php @@ -211,7 +211,8 @@ protected function get_total_objects_for_query( $query_args ) { protected function get_total_objects_for_query_from_db( $query_args ) { $post_count = 0; - if ( ! isset( $query_args['post_type'] ) ) { + if ( ! isset( $query_args['post_type'] ) || isset( $query_args['ep_indexing_upper_limit_object_id'] ) + || isset( $query_args['ep_indexing_lower_limit_object_id'] ) ) { return $post_count; } From f64c11e21b521d022448302d6a83fbf58a71af5a Mon Sep 17 00:00:00 2001 From: Rebecca Hum <16962021+rebeccahum@users.noreply.github.com> Date: Mon, 7 Feb 2022 10:35:56 -0700 Subject: [PATCH 2/2] Fix linting issue --- 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 f2dc42b84c..8edf4f8b87 100644 --- a/includes/classes/Indexable/Post/Post.php +++ b/includes/classes/Indexable/Post/Post.php @@ -211,7 +211,7 @@ protected function get_total_objects_for_query( $query_args ) { protected function get_total_objects_for_query_from_db( $query_args ) { $post_count = 0; - if ( ! isset( $query_args['post_type'] ) || isset( $query_args['ep_indexing_upper_limit_object_id'] ) + if ( ! isset( $query_args['post_type'] ) || isset( $query_args['ep_indexing_upper_limit_object_id'] ) || isset( $query_args['ep_indexing_lower_limit_object_id'] ) ) { return $post_count; }