2021-01-10 23:24:28 +00:00
< ? php
/**
* WooCommerce Admin : Welcome to WooCommerce for store users .
*/
2022-03-08 13:55:27 +00:00
namespace Automattic\WooCommerce\Internal\Admin\Notes ;
2021-01-10 23:24:28 +00:00
defined ( 'ABSPATH' ) || exit ;
2022-03-08 13:55:27 +00:00
use \Automattic\WooCommerce\Admin\Notes\Note ;
use \Automattic\WooCommerce\Admin\Notes\NoteTraits ;
2021-01-10 23:24:28 +00:00
/**
* 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' ),
2021-01-20 04:04:37 +00:00
'https://wordpress.com/support/new-woocommerce-experience-on-wordpress-dot-com/"' ,
2021-01-10 23:24:28 +00:00
Note :: E_WC_ADMIN_NOTE_ACTIONED ,
true
);
return $note ;
}
}