WC_Post_Data::delete_order_downloadable_permissions()public staticWC 1.0

Remove downloadable permissions on permanent order deletion.

Method of the class: WC_Post_Data{}

Return

null. Nothing (null).

Usage

$result = WC_Post_Data::delete_order_downloadable_permissions( $postid );
$postid(int) (required)
Post ID.

WC_Post_Data::delete_order_downloadable_permissions() code WC 8.9.0

public static function delete_order_downloadable_permissions( $postid ) {
	if ( OrderUtil::is_order( $postid, wc_get_order_types() ) ) {
		do_action( 'woocommerce_delete_order_downloadable_permissions', $postid );

		$data_store = WC_Data_Store::load( 'customer-download' );
		$data_store->delete_by_order_id( $postid );

		do_action( 'woocommerce_deleted_order_downloadable_permissions', $postid );
	}
}