Automattic\WooCommerce\Blocks\Utils

ProductDescriptionUtils::is_description_accessible │ private static │ WC 1.0

Whether the current visitor can access a product's description.

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

Хуков нет.

Возвращает

bool.

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

$result = ProductDescriptionUtils::is_description_accessible( $product ): bool;
$product(WC_Product) (обязательный)
Product object.

Код ProductDescriptionUtils::is_description_accessible() WC 11.2.2

private static function is_description_accessible( \WC_Product $product ): bool {
	if ( post_password_required( $product->get_id() ) ) {
		return false;
	}

	$parent_id = $product->get_parent_id();

	return ! $parent_id || ! post_password_required( $parent_id );
}