{$adjacent}_post_link

過濾鉤子
apply_filters( "{$adjacent}_post_link", $output, $format, $link, $post, $adjacent )
引數
  • (string) $output The adjacent post link.
    Required:
  • (string) $format Link anchor format.
    Required:
  • (string) $link Link permalink format.
    Required:
  • (WP_Post) $post The adjacent post.
    Required:
  • (string) $adjacent Whether the post is previous or next.
    Required:
定義位置
相關勾子
adjacent_post_rel_linkedit_post_linkget_adjacent_post_joinpre_post_linkpost_link
相關方法
adjacent_post_linkget_adjacent_post_linkadjacent_posts_rel_linkget_adjacent_post_rel_linkadjacent_image_linkedit_post_link
引入
4.2.0
棄用
-

{$adjacent}_post_link是一個過濾器,用於修改”上一篇”或”下一篇”文章連結的標記。這個過濾器需要兩個引數:連結的HTML輸出和連結所指向的文章物件。

過濾相鄰的文章連結。

鉤子名稱的動態部分,$adjacent,指的是相鄰的型別,’下一個’或’上一個’。

可能的鉤子名稱包括:

  • next_post_link
  • previous_post_link
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
return apply_filters( "{$adjacent}_post_link", $output, $format, $link, $post, $adjacent );
return apply_filters( "{$adjacent}_post_link", $output, $format, $link, $post, $adjacent );
return apply_filters( "{$adjacent}_post_link", $output, $format, $link, $post, $adjacent );

常見問題

FAQs
檢視更多 >