comments_open

過濾鉤子
apply_filters( 'comments_open', $open, $post_id )
引數
  • (bool) $open Whether the current post is open for comments.
    Required:
  • (int) $post_id The post ID.
    Required:
定義位置
相關勾子
comment_closedcomments_per_pagecomment_textcomment_linkcomment_form
相關方法
comments_opencomment_typecomments_linkcomments_popup_linkis_comments_popupadd_comments_page
引入
2.5.0
棄用
-

comments_open: 這個函式返回一個布林值,表示一個給定文章的評論是否開放。預設情況下,所有文章型別的評論都是開放的,但你可以使用comments_open過濾器來修改這一行為。

過濾當前文章是否開放供評論。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
return apply_filters( 'comments_open', $open, $post_id );
return apply_filters( 'comments_open', $open, $post_id );
return apply_filters( 'comments_open', $open, $post_id );

常見問題

FAQs
檢視更多 >