WC_Post_Data::delete_order_downloadable_permissions()public staticWC 1.0

Remove downloadable permissions on permanent order deletion.

{} Это метод класса: WC_Post_Data{}

Возвращает

null. Ничего.

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

$result = WC_Post_Data::delete_order_downloadable_permissions( $postid );
$postid(int) (обязательный)
Post ID.

Код WC_Post_Data::delete_order_downloadable_permissions() WC 6.9.1

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