Skip to content

Commit

Permalink
Redirect changed
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejolley committed Sep 23, 2011
1 parent bdb426c commit f7edcef
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions admin/admin-install.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@ function install_woocommerce() {

// Update version
update_option( "woocommerce_db_version", WOOCOMMERCE_VERSION );

// Flag installed so we can redirect
update_option( "woocommerce_installed", 1 );
}

/**
* Install woocommerce redirect
*/
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;
}

Expand Down

0 comments on commit f7edcef

Please sign in to comment.