WC_Comments::comments_open()
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 Comments::comments open WC 9.8.1
public static function comments_open( $open, $post_id ) { if ( 'product' === get_post_type( $post_id ) && ! post_type_supports( 'product', 'comments' ) ) { $open = false; } return $open; }