get_default_comment_status

过滤钩子
apply_filters( 'get_default_comment_status', $status, $post_type, $comment_type )
参数
  • (string) $status Default status for the given post type, either 'open' or 'closed'.
    Required:
  • (string) $post_type Post type. Default is `post`.
    Required:
  • (string) $comment_type Type of comment. Default is `comment`.
    Required:
定义位置
相关勾子
wp_set_comment_statustransition_comment_statuspost_date_column_statusget_avatar_comment_typesget_comment_text
相关方法
get_default_comment_statusget_comment_statuseswp_set_comment_statuswp_get_comment_statusget_default_block_editor_settingsget_comment_text
引入
4.3.0
弃用
-

get_default_comment_status 函数返回一个文章类型的默认评论状态。它接收一个文章类型作为参数,并返回该文章类型的默认评论状态,可以是”开放”或”关闭”。

过滤给定文章类型的默认评论状态。

return apply_filters( 'get_default_comment_status', $status, $post_type, $comment_type );

常见问题

FAQs
查看更多 >
闪电侠

(工作日 10:00 - 18:30 为您服务)

2026-01-29 12:09:40

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: