WordPress at Your Fingertips
function is not described

WC_Comments::comments_open() public WC 3.1.0

See if comments are open.

{} It's a 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.

Code of WC_Comments::comments_open() WC 5.6.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;
}