Search

apply_filters( "get_{$adjacent}_post_sort", string $order_by, WP_Post $post, string $order )

Filters the ORDER BY clause in the SQL for an adjacent post query.

Description Description

The dynamic portion of the hook name, $adjacent, refers to the type of adjacency, ‘next’ or ‘previous’.


Parameters Parameters

$order_by

(string) The ORDER BY clause in the SQL.

$post

(WP_Post) WP_Post object.

$order

(string) Sort order. 'DESC' for previous post, 'ASC' for next.


In WordPress theme and development, Hooks are functions that can be applied to an Action or a Filter in WordPress. Actions and Filters in WordPress are functions that can be altered by theme and plugin developers to change the default WordPress functionality.

Functions used to alter Actions/Filters in WordPress can be hooked into WordPress. In any case, note that actions and filters are not some thing very similar. Actions are functions performed when a specific occasion happens in WordPress. Filters enable you to change certain functions. Arguments used to hook the two filters and actions appear to be identical. Be that as it may, they are different in functionality and how they carry on.