wpseek.com
WordPress开发者和主题制作者的搜索引擎



get_{$adjacent}_post_sort › WordPress过滤钩子

Since6.9.0
已弃用n/a
› apply_filters( "get_{$adjacent}_post_sort", "ORDER BY p.post_date $order, p.ID $order LIMIT 1", $post, $order )
参数: (3)
  • () order_by The `ORDER BY` clause in the SQL.
    Required: Yes
  • () post WP_Post object.
    Required: Yes
  • () order Sort order. 'DESC' for previous post, 'ASC' for next.
    Required: Yes
定义在:
文档:

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'. Possible hook names include: - `get_next_post_sort` - `get_previous_post_sort`




源码

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