WC_Comments::comments_open
See if comments are open.
Method of the class: WC_Comments{}
No Hooks.
Returns
true|false.
Usage
$result = WC_Comments::comments_open( $open, $post_id );
- $open(true|false) (required)
- Whether the current post is open for comments.
- $post_id(int) (required)
- Post ID.
Changelog
| Since 3.1.0 | Introduced. |
WC_Comments::comments_open() WC Comments::comments open code WC 10.5.0
public static function comments_open( $open, $post_id ) {
if ( 'product' === get_post_type( $post_id ) && ! post_type_supports( 'product', 'comments' ) ) {
$open = false;
}
return $open;
}