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.


Top ↑

Source

File: wp-includes/comment.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.3.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More