WC_Comments::comments_open( bool $open, int $post_id )

See if comments are open.


Description Description


Parameters Parameters

$open

(Required) Whether the current post is open for comments.

$post_id

(Required) Post ID.


Top ↑

Return Return

(bool)


Top ↑

Source Source

File: includes/class-wc-comments.php

	public static function comments_open( $open, $post_id ) {
		if ( 'product' === get_post_type( $post_id ) && ! post_type_supports( 'product', 'comments' ) ) {
			$open = false;
		}
		return $open;
	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.1.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.