Prevent onboarding from running on non-admin pages

This commit is contained in:
Joshua Flowers 2019-07-25 16:20:43 +08:00
parent 67be376009
commit b0aa7bdb42
1 changed files with 4 additions and 0 deletions

View File

@ -45,6 +45,10 @@ class WC_Admin_Onboarding {
* Hook into WooCommerce.
*/
public function __construct() {
if ( ! is_admin() ) {
return;
}
$this->includes();
add_action( 'woocommerce_components_settings', array( $this, 'component_settings' ), 20 ); // Run after WC_Admin_Loader.
add_action( 'woocommerce_theme_installed', array( $this, 'delete_themes_transient' ) );