Automattic\WooCommerce\Blocks\Utils

ProductDescriptionUtils::is_description_accessible │ private static │ WC 1.0

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

Method of the class: ProductDescriptionUtils{}

No Hooks.

Returns

bool.

Usage

$result = ProductDescriptionUtils::is_description_accessible( $product ): bool;
$product(WC_Product) (required)
Product object.

ProductDescriptionUtils::is_description_accessible() code WC 11.3.0

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 );
}