Outil de recherche WordPress pour les développeurs et auteurs de thèmes



get_{$adjacent}_post_sort ›

Depuis4.9.0
Dépréciéen/a
apply_filters( "get_{$adjacent}_post_sort", "ORDER BY p.post_date $order LIMIT 1", $post, $order )
Paramètres: (3)
  • (string) $order_by The `ORDER BY` clause in the SQL.
    Requis: Oui
  • (WP_Post) $post WP_Post object.
    Requis: Oui
  • (string) $order Sort order. 'DESC' for previous post, 'ASC' for next.
    Requis: Oui
Défini(e) dans:
Codex:

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

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





Source

$sort = apply_filters( "get_{$adjacent}_post_sort", "ORDER BY p.post_date $order LIMIT 1", $post, $order );