Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



get_{$adjacent}_post_sort ›

Seit4.9.0
Veraltetn/v
apply_filters( "get_{$adjacent}_post_sort", "ORDER BY p.post_date $order LIMIT 1", $post, $order )
Parameter: (3)
  • (string) $order_by The `ORDER BY` clause in the SQL.
    Erforderlich: Ja
  • (WP_Post) $post WP_Post object.
    Erforderlich: Ja
  • (string) $order Sort order. 'DESC' for previous post, 'ASC' for next.
    Erforderlich: Ja
Definiert in:
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'.





Quellcode

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