Merge branch 'fix-18452'

This commit is contained in:
Mike Jolley 2018-01-22 15:43:32 +00:00
commit 6389f1af9a
1 changed files with 14 additions and 3 deletions

View File

@ -1235,14 +1235,25 @@ class WC_Helper {
/**
* Prompt a Helper connection if the user has WooCommerce.com extensions.
*
* @param string $screen_id Current screen ID.
*/
private static function _prompt_helper_connect( $screen_id ) {
// Don't show the notice on the Helper screens.
if ( 'woocommerce_page_wc-addons' == $screen_id && ! empty( $_REQUEST['section'] ) && 'helper' == $_REQUEST['section'] ) {
$screens = wc_get_screen_ids();
$screens[] = 'plugins';
if ( ! in_array( $screen_id, $screens, true ) ) {
return;
}
// We believe have an active connection.
// Don't show the notice on the Helper screens.
$screen_addons = sanitize_title( __( 'WooCommerce', 'woocommerce' ) ) . '_page_wc-addons';
if ( $screen_addons === $screen_id && ! empty( $_REQUEST['section'] ) && 'helper' === $_REQUEST['section'] ) {
return;
}
// We believe we have an active connection.
$auth = WC_Helper_Options::get( 'auth' );
if ( ! empty( $auth['access_token'] ) ) {
return;