Redirect changed
This commit is contained in:
parent
bdb426c90e
commit
f7edcef33e
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue