W3cubDocs

/WordPress

apply_filters( ‘comments_open’, bool $comments_open, int $post_id )

Filters whether the current post is open for comments.

Parameters

$comments_openbool
Whether the current post is open for comments.
$post_idint
The post ID.

Source

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

Changelog

Version Description
2.5.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/comments_open