Skip to content

Commit

Permalink
No need to hook the message. OK to display directly.
Browse files Browse the repository at this point in the history
  • Loading branch information
Allen Snook committed Feb 3, 2020
1 parent a81ee6d commit f6c5255
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions includes/class-wc-payments.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,16 @@ public static function check_plugin_dependencies( $silent ) {

// TODO - Remove/update when Jetpack Connection package is all we need.
if ( ! self::check_for_jetpack_layer() ) {
if ( ! $silent ) {
$message = sprintf(
/* translators: %1: WooCommerce Payments version */
__( 'WooCommerce Payments %1$s requires Jetpack. Please install, activate and connect Jetpack. This dependency will change in an upcoming release.', 'woocommerce-payments' ),
WCPAY_VERSION_NUMBER
);

self::display_admin_error( $message );
}

return false;
};

Expand Down Expand Up @@ -248,18 +258,6 @@ public static function check_for_jetpack_layer() {
return true;
}

$message = sprintf(
/* translators: %1: WooCommerce Payments version */
__( 'WooCommerce Payments %1$s requires Jetpack at this time. Please install, activate and connect Jetpack.', 'woocommerce-payments' ),
WCPAY_VERSION_NUMBER
);

add_filter(
'admin_notices',
function () use ( $message ) {
self::display_admin_error( $message );
}
);
return false;
}

Expand Down

0 comments on commit f6c5255

Please sign in to comment.