WC_Post_Data::delete_order_downloadable_permissions PHP Method

delete_order_downloadable_permissions() public static method

Remove downloadable permissions on permanent order deletion.
public static delete_order_downloadable_permissions ( $postid )
    public static function delete_order_downloadable_permissions($postid)
    {
        global $wpdb;
        if (in_array(get_post_type($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);
        }
    }