Add wp 5.0 checks to wootenberg notice checks.

This commit is contained in:
Gerhard 2018-11-15 15:26:19 +02:00
parent d3c67b675b
commit 341c0a8277
1 changed files with 9 additions and 6 deletions

View File

@ -118,7 +118,8 @@ class WC_Admin_Notices {
/** /**
* See if a notice is being shown. * See if a notice is being shown.
* *
* @param string $name Notice name. * @param string $name Notice name.
*
* @return boolean * @return boolean
*/ */
public static function has_notice( $name ) { 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. * If Gutenberg is active, tell people about the Products block feature plugin.
* *
* @since 3.4.3 * @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() { 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' ); self::add_notice( 'wootenberg' );
} }
} }
@ -376,10 +378,11 @@ class WC_Admin_Notices {
* Tell people about the Products block feature plugin when they activate Gutenberg. * Tell people about the Products block feature plugin when they activate Gutenberg.
* *
* @since 3.4.3 * @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() { 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' ); self::add_notice( 'wootenberg' );
} }
} }
@ -400,7 +403,7 @@ class WC_Admin_Notices {
* Determine if the store is running SSL. * Determine if the store is running SSL.
* *
* @return bool Flag SSL enabled. * @return bool Flag SSL enabled.
* @since 3.5.1 * @since 3.5.1
*/ */
protected static function is_ssl() { protected static function is_ssl() {
$shop_page = 0 < wc_get_page_id( 'shop' ) ? get_permalink( wc_get_page_id( 'shop' ) ) : get_home_url(); $shop_page = 0 < wc_get_page_id( 'shop' ) ? get_permalink( wc_get_page_id( 'shop' ) ) : get_home_url();