Add note for users coming from Calypso (https://github.com/woocommerce/woocommerce-admin/pull/6030)
* Add note for users coming from Calypso if the site has wpcomsh installed * remove check for wpcomsh * Add release note
This commit is contained in:
parent
6d3d81abba
commit
fe871be92d
|
@ -87,6 +87,7 @@ Release and roadmap notes are available on the [WooCommerce Developers Blog](htt
|
|||
- Add: Welcome modal when coming from Calypso #6004
|
||||
- Enhancement: Add an a/b experiment for installing free business features #5786
|
||||
- Dev: Add `onChangeCallback` feature to the wc-admin <Form> component #5786
|
||||
- Add: Note for users coming from Calypso. #6030
|
||||
|
||||
== Changelog ==
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ use \Automattic\WooCommerce\Admin\RemoteInboxNotifications\RemoteInboxNotificati
|
|||
use \Automattic\WooCommerce\Admin\Notes\SetUpAdditionalPaymentTypes;
|
||||
use \Automattic\WooCommerce\Admin\Notes\TestCheckout;
|
||||
use \Automattic\WooCommerce\Admin\Notes\SellingOnlineCourses;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WelcomeToWooCommerceForStoreUsers;
|
||||
|
||||
/**
|
||||
* Feature plugin main class.
|
||||
|
@ -191,6 +192,7 @@ class FeaturePlugin {
|
|||
new SetUpAdditionalPaymentTypes();
|
||||
new TestCheckout();
|
||||
new SellingOnlineCourses();
|
||||
new WelcomeToWooCommerceForStoreUsers();
|
||||
|
||||
// Initialize RemoteInboxNotificationsEngine.
|
||||
RemoteInboxNotificationsEngine::init();
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
/**
|
||||
* WooCommerce Admin: Welcome to WooCommerce for store users.
|
||||
*/
|
||||
|
||||
namespace Automattic\WooCommerce\Admin\Notes;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* Welcome to WooCommerce for store users.
|
||||
*/
|
||||
class WelcomeToWooCommerceForStoreUsers {
|
||||
/**
|
||||
* Note traits.
|
||||
*/
|
||||
use NoteTraits;
|
||||
|
||||
/**
|
||||
* Name of the note for use in the database.
|
||||
*/
|
||||
const NOTE_NAME = 'wc-admin-welcome-to-woocommerce-for-store-users';
|
||||
|
||||
/**
|
||||
* Attach hooks.
|
||||
*/
|
||||
public function __construct() {
|
||||
add_action( 'init', array( $this, 'possibly_add_note' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the note.
|
||||
*
|
||||
* @return Note|null
|
||||
*/
|
||||
public static function get_note() {
|
||||
// Only add if coming from Calypso.
|
||||
if ( ! isset( $_GET['from-calypso'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification
|
||||
return;
|
||||
}
|
||||
|
||||
$note = new Note();
|
||||
$note->set_title( __( 'Welcome to your new store management experience', 'woocommerce-admin' ) );
|
||||
$note->set_content( __( "We've designed your navigation and home screen to help you focus on the things that matter most in managing your online store.", 'woocommerce-admin' ) );
|
||||
$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_name( self::NOTE_NAME );
|
||||
$note->set_source( 'woocommerce-admin' );
|
||||
$note->add_action(
|
||||
'learn-more',
|
||||
__( 'Learn more', 'woocommerce-admin' ),
|
||||
'https://wordpress.com/support/store/"',
|
||||
Note::E_WC_ADMIN_NOTE_ACTIONED,
|
||||
true
|
||||
);
|
||||
|
||||
return $note;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue