get_default_comment_status WordPress Filter Hook
The get_default_comment_status hook allows you to set the default comment status for new posts and pages. By default, comments are closed for new posts and pages, but you can use this hook to change that behavior.
apply_filters( 'get_default_comment_status', string $status , string $post_type , string $comment_type ) #
Filters the default comment status for the given post type.
Parameters
- $status
(string)Default status for the given post type, either 'open' or 'closed'.
- $post_type
(string)Post type. Default is
post
.- $comment_type
(string)Type of comment. Default is
comment
.
Source
File: wp-includes/comment.php
Changelog
Version | Description |
---|---|
4.3.0 | Introduced. |