Automattic\WooCommerce\Internal\Abilities\Domain

ProductDelete::can_delete_productpublic staticWC 10.9.0

Check product deletion access.

Method of the class: ProductDelete{}

No Hooks.

Returns

true|false.

Usage

$result = ProductDelete::can_delete_product( $input ): bool;
$input(mixed)
Ability input.
Default: array()

Changelog

Since 10.9.0 Introduced.

ProductDelete::can_delete_product() code WC 11.0.1

public static function can_delete_product( $input = array() ): bool {
	$product_id = self::get_id_from_input( $input );

	return $product_id > 0 && wc_rest_check_post_permissions( 'product', 'delete', $product_id );
}