Redirect changed

This commit is contained in:
Mike Jolley 2011-09-23 18:37:35 +01:00
parent bdb426c90e
commit f7edcef33e
1 changed files with 5 additions and 5 deletions

View File

@ -27,9 +27,6 @@ function install_woocommerce() {
// Update version
update_option( "woocommerce_db_version", WOOCOMMERCE_VERSION );
// Flag installed so we can redirect
update_option( "woocommerce_installed", 1 );
}
/**
@ -37,11 +34,14 @@ function install_woocommerce() {
*/
add_action('admin_init', 'install_woocommerce_redirect');
function install_woocommerce_redirect() {
if (get_option('woocommerce_installed')==1) :
update_option( "woocommerce_installed", 0 );
global $pagenow;
if ( is_admin() && isset( $_GET['activate'] ) && ($_GET['activate'] == true) && $pagenow == 'plugins.php' ) :
flush_rewrite_rules( false );
wp_redirect(admin_url('admin.php?page=woocommerce&installed=true'));
exit;
endif;
}