WC_Comments::comments_open()public staticWC 3.1.0

See if comments are open.

Метод класса: WC_Comments{}

Хуков нет.

Возвращает

true|false.

Использование

$result = WC_Comments::comments_open( $open, $post_id );
$open(true|false) (обязательный)
Whether the current post is open for comments.
$post_id(int) (обязательный)
Post ID.

Список изменений

С версии 3.1.0 Введена.

Код WC_Comments::comments_open() WC 8.7.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;
}