woocommerce_enable_setup_wizard filter

This commit is contained in:
Mike Jolley 2015-04-29 10:59:59 +01:00
parent 4b92f642b3
commit 7263a4ace2
2 changed files with 3 additions and 3 deletions

View File

@ -57,7 +57,7 @@ class WC_Admin {
// Setup/welcome
if ( ! empty( $_GET['page'] ) && current_user_can( 'manage_woocommerce' ) ) {
if ( 'wc-setup' === $_GET['page'] ) {
if ( apply_filters( 'woocommerce_enable_setup_wizard', true ) && 'wc-setup' === $_GET['page'] ) {
include_once( 'class-wc-admin-setup-wizard.php' );
} elseif ( 'wc-about' === $_GET['page'] || 'wc-credits' === $_GET['page'] || 'wc-translators' === $_GET['page'] ) {
include_once( 'class-wc-admin-welcome.php' );
@ -120,7 +120,7 @@ class WC_Admin {
return;
}
if ( get_transient( '_wc_setup_redirect' ) ) {
if ( apply_filters( 'woocommerce_enable_setup_wizard', true ) && get_transient( '_wc_setup_redirect' ) ) {
delete_transient( '_wc_setup_redirect' );
wp_redirect( admin_url( 'index.php?page=wc-setup' ) );
exit;

View File

@ -103,7 +103,7 @@ class WC_Install {
WC_Admin_Notices::remove_all_notices();
// No versions? This is a new install :)
if ( is_null( $current_wc_version ) && is_null( $current_db_version ) ) {
if ( is_null( $current_wc_version ) && is_null( $current_db_version ) && apply_filters( 'woocommerce_enable_setup_wizard', true ) ) {
WC_Admin_Notices::add_notice( 'install' );
set_transient( '_wc_setup_redirect', 1, 30 );