2013-05-31 15:13:14 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Update WC to 2.1.0
|
|
|
|
*
|
|
|
|
* @author WooThemes
|
|
|
|
* @category Admin
|
|
|
|
* @package WooCommerce/Admin/Updates
|
|
|
|
* @version 2.1.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
|
|
|
|
|
|
|
global $wpdb, $woocommerce;
|
|
|
|
|
|
|
|
// Pages no longer used
|
|
|
|
wp_delete_post( get_option('woocommerce_pay_page_id'), true );
|
2013-06-04 16:33:43 +00:00
|
|
|
wp_delete_post( get_option('woocommerce_thanks_page_id'), true );
|
2013-06-05 11:07:23 +00:00
|
|
|
wp_delete_post( get_option('woocommerce_view_order_page_id'), true );
|
2013-07-16 13:40:07 +00:00
|
|
|
wp_delete_post( get_option('woocommerce_change_password_page_id'), true );
|
2013-07-23 16:05:01 +00:00
|
|
|
wp_delete_post( get_option('woocommerce_edit_address_page_id'), true );
|
|
|
|
wp_delete_post( get_option('woocommerce_lost_password_page_id'), true );
|
2013-07-16 13:40:07 +00:00
|
|
|
|
|
|
|
// Update table primary keys - remove old key and then add new 'permission_id' row.
|
|
|
|
//$wpdb->hide_errors();
|
|
|
|
$wpdb->query( "ALTER TABLE {$wpdb->prefix}woocommerce_downloadable_product_permissions DROP PRIMARY KEY" );
|
|
|
|
$wpdb->query( "ALTER TABLE {$wpdb->prefix}woocommerce_downloadable_product_permissions ADD `permission_id` bigint(20) NOT NULL PRIMARY KEY AUTO_INCREMENT" );
|