diff --git a/projects/plugins/jetpack/modules/infinite-scroll/infinity.php b/projects/plugins/jetpack/modules/infinite-scroll/infinity.php index 47084669d3219..f56fdd98231c4 100644 --- a/projects/plugins/jetpack/modules/infinite-scroll/infinity.php +++ b/projects/plugins/jetpack/modules/infinite-scroll/infinity.php @@ -772,6 +772,8 @@ public function query_time_filter( $where, $query ) { * will always return results prior to (descending sort) * or before (ascending sort) the last post date. * + * @deprecated $$next-version$$ + * * @module infinite-scroll * * @param string $clause SQL Date query. @@ -779,9 +781,9 @@ public function query_time_filter( $where, $query ) { * @param string $operator @deprecated Query operator. * @param string $last_post_date @deprecated Last Post Date timestamp. */ - $operator = 'ASC' === $_REQUEST['query_args']['order'] ? '>' : '<'; // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput.InputNotValidated -- no changes to the site. - $last_post_date = isset( $_REQUEST['last_post_date'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['last_post_date'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- no changes to the site. - $where .= apply_filters( 'infinite_scroll_posts_where', $clause, $query, $operator, $last_post_date ); + $operator = '<'; + $last_post_date = isset( $_REQUEST['last_post_date'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['last_post_date'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- no changes to the site + $where .= apply_filters_deprecated( 'infinite_scroll_posts_where', array( $clause, $query, $operator, $last_post_date ), '$$next-version$$', '' ); } return $where;