Flush on upgrade

This commit is contained in:
Mike Jolley 2013-03-04 15:29:30 +00:00
parent 89153d2920
commit 995421b34f
2 changed files with 4 additions and 3 deletions

View File

@ -122,6 +122,10 @@ class WC_Welcome_Page {
private function intro() {
global $woocommerce;
// Flush rules after update
if ( ! empty( $_GET['wc-updated'] ) )
flush_rewrite_rules( false );
// Drop minor version if 0
$major_version = strstr( $woocommerce->version, '0.0' ) ? substr( $woocommerce->version, 0, 3 ) : $woocommerce->version;
?>

View File

@ -284,9 +284,6 @@ function woocommerce_admin_init() {
delete_option( '_wc_install_pages' );
delete_option( '_wc_needs_update' );
// Flush rules after update
flush_rewrite_rules( false );
// What's new redirect
wp_safe_redirect( admin_url( 'index.php?page=wc-about&wc-updated=true' ) );
exit;