WC_Comments::comments_open()
See if comments are open.
Method of the class: WC_Comments{}
No Hooks.
Return
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 9.4.2
public static function comments_open( $open, $post_id ) { if ( 'product' === get_post_type( $post_id ) && ! post_type_supports( 'product', 'comments' ) ) { $open = false; } return $open; }