From 341c0a82776cc28b539e63915f27bec63be20a82 Mon Sep 17 00:00:00 2001 From: Gerhard Date: Thu, 15 Nov 2018 15:26:19 +0200 Subject: [PATCH] Add wp 5.0 checks to wootenberg notice checks. --- includes/admin/class-wc-admin-notices.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/includes/admin/class-wc-admin-notices.php b/includes/admin/class-wc-admin-notices.php index fc2ec0f58ce..15067629385 100644 --- a/includes/admin/class-wc-admin-notices.php +++ b/includes/admin/class-wc-admin-notices.php @@ -118,7 +118,8 @@ class WC_Admin_Notices { /** * See if a notice is being shown. * - * @param string $name Notice name. + * @param string $name Notice name. + * * @return boolean */ public static function has_notice( $name ) { @@ -364,10 +365,11 @@ class WC_Admin_Notices { * If Gutenberg is active, tell people about the Products block feature plugin. * * @since 3.4.3 - * @todo Remove this notice and associated code once the feature plugin has been merged into core. + * @todo Remove this notice and associated code once the feature plugin has been merged into core. */ public static function add_wootenberg_feature_plugin_notice() { - if ( is_plugin_active( 'gutenberg/gutenberg.php' ) && ! is_plugin_active( 'woo-gutenberg-products-block/woocommerce-gutenberg-products-block.php' ) ) { + global $wp_version; + if ( ( is_plugin_active( 'gutenberg/gutenberg.php' ) || version_compare( $wp_version, '5.0', '>=' ) ) && ! is_plugin_active( 'woo-gutenberg-products-block/woocommerce-gutenberg-products-block.php' ) ) { self::add_notice( 'wootenberg' ); } } @@ -376,10 +378,11 @@ class WC_Admin_Notices { * Tell people about the Products block feature plugin when they activate Gutenberg. * * @since 3.4.3 - * @todo Remove this notice and associated code once the feature plugin has been merged into core. + * @todo Remove this notice and associated code once the feature plugin has been merged into core. */ public static function add_wootenberg_feature_plugin_notice_on_gutenberg_activate() { - if ( ! is_plugin_active( 'woo-gutenberg-products-block/woocommerce-gutenberg-products-block.php' ) ) { + global $wp_version; + if ( ! is_plugin_active( 'woo-gutenberg-products-block/woocommerce-gutenberg-products-block.php' ) && version_compare( $wp_version, '5.0', '<' ) ) { self::add_notice( 'wootenberg' ); } } @@ -400,7 +403,7 @@ class WC_Admin_Notices { * Determine if the store is running SSL. * * @return bool Flag SSL enabled. - * @since 3.5.1 + * @since 3.5.1 */ protected static function is_ssl() { $shop_page = 0 < wc_get_page_id( 'shop' ) ? get_permalink( wc_get_page_id( 'shop' ) ) : get_home_url();