comments_open
Filters whether the current post is open for comments.
Description
Parameters (1)
- 0. $return_false (string) =>
'__return_false'
- The return false.
Usage
- To run the hook, copy the example below.
- $return_false = apply_filters( 'comments_open', $return_false );
- if ( !empty( $return_false ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the comments_open callback
- function filter_comments_open( $return_false ) {
- // make filter magic happen here...
- return $return_false;
- };
- // add the filter
- add_filter( 'comments_open', 'filter_comments_open', 10, 1 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'comments_open', 'filter_comments_open', 10, 1 );
Defined (1)
The filter is defined in the following location(s).
- /class.frame-nonce-preview.php
- add_filter( 'comments_open', '__return_false' );