From 87c34e476ec97e66f905ab67c49db02fe33c09de Mon Sep 17 00:00:00 2001 From: Dat Hoang Date: Wed, 29 Sep 2021 15:01:28 +0700 Subject: [PATCH] Continue loading WCPay if the account is currently connected. --- includes/class-wc-payments.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/includes/class-wc-payments.php b/includes/class-wc-payments.php index c534c51675b..6c026692fa6 100644 --- a/includes/class-wc-payments.php +++ b/includes/class-wc-payments.php @@ -159,7 +159,16 @@ public static function init() { if ( ! self::check_plugin_dependencies( true ) ) { add_filter( 'admin_notices', [ __CLASS__, 'check_plugin_dependencies' ] ); - return; + + /** + * After displaying notice errors in WP Admin, still silently load the plugin if the account is connected. + * + * @since 3.1.0 + */ + $account_data = get_option( 'wcpay_account_data' ); + if ( ! isset( $account_data['account'] ) ) { + return; + }; } add_action( 'admin_init', [ __CLASS__, 'add_woo_admin_notes' ] );