Enabled product bundles

This commit is contained in:
Nedim Uka
2018-06-29 14:40:28 +02:00
parent e0514f7f57
commit b5475ff2f1
12004 changed files with 1694047 additions and 1610 deletions

View File

@@ -34,6 +34,7 @@ class WC_Admin_Notices {
'simplify_commerce' => 'simplify_commerce_notice',
'regenerating_thumbnails' => 'regenerating_thumbnails_notice',
'no_secure_connection' => 'secure_connection_notice',
'wootenberg' => 'wootenberg_feature_plugin_notice',
);
/**
@@ -49,6 +50,7 @@ class WC_Admin_Notices {
if ( current_user_can( 'manage_woocommerce' ) ) {
add_action( 'admin_print_styles', array( __CLASS__, 'add_notices' ) );
add_action( 'activate_gutenberg/gutenberg.php', array( __CLASS__, 'add_wootenberg_feature_plugin_notice_on_gutenberg_activate' ) );
}
}
@@ -91,6 +93,7 @@ class WC_Admin_Notices {
WC_Admin_Notices::add_notice( 'no_secure_connection' );
}
WC_Admin_Notices::add_wootenberg_feature_plugin_notice();
self::add_notice( 'template_files' );
}
@@ -357,6 +360,42 @@ class WC_Admin_Notices {
include dirname( __FILE__ ) . '/views/html-notice-secure-connection.php';
}
/**
* 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.
*/
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' ) ) {
self::add_notice( 'wootenberg' );
}
}
/**
* 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.
*/
public static function add_wootenberg_feature_plugin_notice_on_gutenberg_activate() {
if ( ! is_plugin_active( 'woo-gutenberg-products-block/woocommerce-gutenberg-products-block.php' ) ) {
self::add_notice( 'wootenberg' );
}
}
/**
* Notice about trying the Products block.
*/
public static function wootenberg_feature_plugin_notice() {
if ( get_user_meta( get_current_user_id(), 'dismissed_wootenberg_notice', true ) || is_plugin_active( 'woo-gutenberg-products-block/woocommerce-gutenberg-products-block.php' ) ) {
self::remove_notice( 'wootenberg' );
return;
}
include dirname( __FILE__ ) . '/views/html-notice-wootenberg.php';
}
}
WC_Admin_Notices::init();