Skip to content

Commit

Permalink
Deprecate infinite_scroll_posts_where hook
Browse files Browse the repository at this point in the history
  • Loading branch information
darssen committed Oct 7, 2024
1 parent d9973a1 commit 3b49148
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions projects/plugins/jetpack/modules/infinite-scroll/infinity.php
Original file line number Diff line number Diff line change
Expand Up @@ -772,16 +772,18 @@ 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.
* @param object $query 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;
Expand Down

0 comments on commit 3b49148

Please sign in to comment.