category_link

過濾鉤子
apply_filters( 'category_link', $termlink, $term->term_id )
引數
  • (string) $termlink Category link URL.
    Required:
  • (int) $term_id Term ID.
    Required:
定義位置
相關勾子
category_feed_linkauthor_linkterm_linktag_linkday_link
相關方法
get_category_linkget_category_rss_linkget_category_feed_linkthe_category_idcategory_existscategory_description
引入
5.4.1
棄用
-

category_link: 這是WordPress的一個過濾鉤子,允許開發者修改一個類別的固定連結。category_link鉤子將預設的固定連結作為一個引數傳遞,鉤子函式可以返回一個修改後的固定連結來代替。這對於改變類別permalinks的行為或外觀很有用。

過濾類別連結。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$termlink = apply_filters( 'category_link', $termlink, $term->term_id );
$termlink = apply_filters( 'category_link', $termlink, $term->term_id );
$termlink = apply_filters( 'category_link', $termlink, $term->term_id );

常見問題

FAQs
檢視更多 >