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:
定义位置
  • wp-includes/comment-template.php
    , line 1251
引入
2.5.0
弃用

过滤当前文章是否开放供评论。

return apply_filters( 'comments_open', $open, $post_id );