post_link_category

過濾鉤子
apply_filters( 'post_link_category', $cats[0], $cats, $post )
引數
  • (WP_Term) $cat The category to use in the permalink.
    Required:
  • (array) $cats Array of all categories (WP_Term objects) associated with the post.
    Required:
  • (WP_Post) $post The post in question.
    Required:
定義位置
相關勾子
link_categorythe_categorypost_linkwp_link_querynext_posts_link_attributes
相關方法
in_categorywp_insert_categorywp_set_link_catswp_ajax_add_link_categoryis_categorywp_link_category_checklist
引入
3.5.0
棄用
-

post_thumbnail_id: 這個鉤子允許你在儲存之前修改文章縮圖(特色圖片)的ID。

過濾%category%固定連結令牌中使用的類別。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$category_object = apply_filters( 'post_link_category', $cats[0], $cats, $post );
$category_object = apply_filters( 'post_link_category', $cats[0], $cats, $post );
$category_object = apply_filters( 'post_link_category', $cats[0], $cats, $post );

常見問題

FAQs
檢視更多 >