get_{$adjacent}_post_join

过滤钩子
apply_filters( "get_{$adjacent}_post_join", $join, $in_same_term, $excluded_terms, $taxonomy, $post )
参数
  • (string) $join The JOIN clause in the SQL.
    Required:
  • (bool) $in_same_term Whether post should be in a same taxonomy term.
    Required:
  • (int[]|string) $excluded_terms Array of excluded term IDs. Empty string if none were provided.
    Required:
  • (string) $taxonomy Taxonomy. Used to identify the term used when `$in_same_term` is true.
    Required:
  • (WP_Post) $post WP_Post object.
    Required:
定义位置
相关勾子
get_adjacent_post_sortget_adjacent_post_whereadjacent_post_linkget_delete_post_linkget_edit_post_link
相关方法
get_adjacent_post_linkget_adjacent_postget_adjacent_post_rel_linkadjacent_post_linkget_delete_post_linkget_adjacent_image_link
引入
4.4.0
弃用
-

get_{$adjacent}_post_join: 此函数用于检索查询中连接表的SQL语句,以获得相邻文章。

为相邻的post查询过滤SQL中的JOIN子句。

钩子名称的动态部分$adjacent指的是邻接类型,“next”或“previous”。

可能的挂钩名称包括:

  • get_next_post_join
  • get_previous_post_join
$join = apply_filters( "get_{$adjacent}_post_join", $join, $in_same_term, $excluded_terms, $taxonomy, $post );

常见问题

FAQs
查看更多 >