Rename admin notes classes and file names to fit conventions (https://github.com/woocommerce/woocommerce-admin/pull/5142)
* Rename admin notes classes and file names to fit conventions * Use a facade class that adds deprecation warnings to each function call * Tidy up after rebase Co-authored-by: Rebecca Scott <me@becdetat.com>
This commit is contained in:
parent
df91b1f0a6
commit
ad8f8c5b08
|
@ -67,7 +67,7 @@ class WooCommerce_Activity_Panel_Inbox_Example_Plugin_One {
|
|||
* Adds a note to the merchant' inbox.
|
||||
*/
|
||||
public static function add_activity_panel_inbox_welcome_note() {
|
||||
if ( ! class_exists( 'WC_Admin_Notes' ) ) {
|
||||
if ( ! class_exists( 'Notes' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -80,7 +80,7 @@ class WooCommerce_Activity_Panel_Inbox_Example_Plugin_One {
|
|||
// First, see if we've already created this kind of note so we don't do it again.
|
||||
$note_ids = $data_store->get_notes_with_name( self::NOTE_NAME );
|
||||
foreach( (array) $note_ids as $note_id ) {
|
||||
$note = WC_Admin_Notes::get_note( $note_id );
|
||||
$note = Notes::get_note( $note_id );
|
||||
$content_data = $note->get_content_data();
|
||||
if ( property_exists( $content_data, 'getting_started' ) ) {
|
||||
return;
|
||||
|
@ -90,7 +90,7 @@ class WooCommerce_Activity_Panel_Inbox_Example_Plugin_One {
|
|||
// Otherwise, add the note
|
||||
$activated_time = current_time( 'timestamp', 0 );
|
||||
$activated_time_formatted = date( 'F jS', $activated_time );
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
$note->set_title( __( 'Getting Started', 'wapi-example-plugin-one' ) );
|
||||
$note->set_content(
|
||||
sprintf(
|
||||
|
@ -104,7 +104,7 @@ class WooCommerce_Activity_Panel_Inbox_Example_Plugin_One {
|
|||
'activated' => $activated_time,
|
||||
'activated_formatted' => $activated_time_formatted,
|
||||
) );
|
||||
$note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_layout('plain');
|
||||
$note->set_image('');
|
||||
$note->set_name( self::NOTE_NAME );
|
||||
|
@ -129,11 +129,11 @@ class WooCommerce_Activity_Panel_Inbox_Example_Plugin_One {
|
|||
* Removes any notes this plugin created.
|
||||
*/
|
||||
public static function remove_activity_panel_inbox_notes() {
|
||||
if ( ! class_exists( 'WC_Admin_Notes' ) ) {
|
||||
if ( ! class_exists( 'Notes' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
WC_Admin_Notes::delete_notes_with_name( self::NOTE_NAME );
|
||||
Notes::delete_notes_with_name( self::NOTE_NAME );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -171,7 +171,7 @@ class WooCommerce_Activity_Panel_Inbox_Example_Plugin_Two {
|
|||
* Adds a note to the merchant' inbox.
|
||||
*/
|
||||
public static function add_or_update_activity_panel_inbox_note() {
|
||||
if ( ! class_exists( 'WC_Admin_Notes' ) ) {
|
||||
if ( ! class_exists( 'Notes' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -184,10 +184,10 @@ class WooCommerce_Activity_Panel_Inbox_Example_Plugin_Two {
|
|||
// First, see if we've already created our note so we don't do it again.
|
||||
$note_ids = $data_store->get_notes_with_name( self::NOTE_NAME );
|
||||
if ( empty( $note_ids ) ) {
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
$note->set_title( __( 'Domain Renewal Coming Up', 'wapi-example-plugin-two' ) );
|
||||
} else {
|
||||
$note = WC_Admin_Notes::get_note( $note_ids[0] );
|
||||
$note = Notes::get_note( $note_ids[0] );
|
||||
}
|
||||
|
||||
$expires_in_days = rand( 2, 365 );
|
||||
|
@ -202,7 +202,7 @@ class WooCommerce_Activity_Panel_Inbox_Example_Plugin_Two {
|
|||
'expires_in_days' => $expires_in_days,
|
||||
) );
|
||||
|
||||
$note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_layout('plain');
|
||||
$note->set_image('');
|
||||
$note->set_name( self::NOTE_NAME );
|
||||
|
@ -217,11 +217,11 @@ class WooCommerce_Activity_Panel_Inbox_Example_Plugin_Two {
|
|||
* Removes any notes this plugin created.
|
||||
*/
|
||||
public static function remove_activity_panel_inbox_notes() {
|
||||
if ( ! class_exists( 'WC_Admin_Notes' ) ) {
|
||||
if ( ! class_exists( 'Notes' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
WC_Admin_Notes::delete_notes_with_name( self::NOTE_NAME );
|
||||
Notes::delete_notes_with_name( self::NOTE_NAME );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
*/
|
||||
|
||||
use \Automattic\WooCommerce\Admin\Install as Installer;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Deactivate_Plugin;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Notes;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Deactivate_Plugin;
|
||||
|
||||
/**
|
||||
* Update order stats `status` index length.
|
||||
|
@ -68,8 +68,8 @@ function wc_admin_update_0230_db_version() {
|
|||
* Remove the note unsnoozing scheduled action.
|
||||
*/
|
||||
function wc_admin_update_0251_remove_unsnooze_action() {
|
||||
as_unschedule_action( WC_Admin_Notes::UNSNOOZE_HOOK, null, 'wc-admin-data' );
|
||||
as_unschedule_action( WC_Admin_Notes::UNSNOOZE_HOOK, null, 'wc-admin-notes' );
|
||||
as_unschedule_action( Notes::UNSNOOZE_HOOK, null, 'wc-admin-data' );
|
||||
as_unschedule_action( Notes::UNSNOOZE_HOOK, null, 'wc-admin-notes' );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -83,7 +83,7 @@ function wc_admin_update_0251_db_version() {
|
|||
* Remove Facebook Extension note.
|
||||
*/
|
||||
function wc_admin_update_110_remove_facebook_note() {
|
||||
WC_Admin_Notes::delete_notes_with_name( 'wc-admin-facebook-extension' );
|
||||
Notes::delete_notes_with_name( 'wc-admin-facebook-extension' );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -115,7 +115,7 @@ function wc_admin_update_130_db_version() {
|
|||
function wc_admin_update_140_change_deactivate_plugin_note_type() {
|
||||
global $wpdb;
|
||||
|
||||
$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->prefix}wc_admin_notes SET type = 'info' WHERE name = %s", WC_Admin_Notes_Deactivate_Plugin::NOTE_NAME ) );
|
||||
$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->prefix}wc_admin_notes SET type = 'info' WHERE name = %s", Deactivate_Plugin::NOTE_NAME ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -9,8 +9,8 @@ namespace Automattic\WooCommerce\Admin\API;
|
|||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
use Automattic\WooCommerce\Admin\Notes\WC_Admin_Note;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes;
|
||||
use Automattic\WooCommerce\Admin\Notes\Note;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Notes as NotesFactory;
|
||||
|
||||
/**
|
||||
* REST API Admin Note Action controller class.
|
||||
|
@ -55,7 +55,7 @@ class NoteActions extends Notes {
|
|||
* @return WP_REST_Request|WP_Error
|
||||
*/
|
||||
public function trigger_note_action( $request ) {
|
||||
$note = WC_Admin_Notes::get_note( $request->get_param( 'note_id' ) );
|
||||
$note = NotesFactory::get_note( $request->get_param( 'note_id' ) );
|
||||
|
||||
if ( ! $note ) {
|
||||
return new \WP_Error(
|
||||
|
@ -87,8 +87,8 @@ class NoteActions extends Notes {
|
|||
/**
|
||||
* Fires when an admin note action is taken.
|
||||
*
|
||||
* @param string $name The triggered action name.
|
||||
* @param WC_Admin_Note $note The corresponding Note.
|
||||
* @param string $name The triggered action name.
|
||||
* @param Note $note The corresponding Note.
|
||||
*/
|
||||
do_action( 'woocommerce_note_action', $triggered_action->name, $note );
|
||||
|
||||
|
@ -96,7 +96,7 @@ class NoteActions extends Notes {
|
|||
* Fires when an admin note action is taken.
|
||||
* For more specific targeting of note actions.
|
||||
*
|
||||
* @param WC_Admin_Note $note The corresponding Note.
|
||||
* @param Note $note The corresponding Note.
|
||||
*/
|
||||
do_action( 'woocommerce_note_action_' . $triggered_action->name, $note );
|
||||
|
||||
|
|
|
@ -9,8 +9,8 @@ namespace Automattic\WooCommerce\Admin\API;
|
|||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
use Automattic\WooCommerce\Admin\Notes\WC_Admin_Note;
|
||||
use Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes;
|
||||
use Automattic\WooCommerce\Admin\Notes\Note;
|
||||
use Automattic\WooCommerce\Admin\Notes\Notes as NotesRepository;
|
||||
|
||||
/**
|
||||
* REST API Admin Notes controller class.
|
||||
|
@ -122,7 +122,7 @@ class Notes extends \WC_REST_CRUD_Controller {
|
|||
* @return WP_REST_Response|WP_Error
|
||||
*/
|
||||
public function get_item( $request ) {
|
||||
$note = WC_Admin_Notes::get_note( $request->get_param( 'id' ) );
|
||||
$note = NotesRepository::get_note( $request->get_param( 'id' ) );
|
||||
|
||||
if ( ! $note ) {
|
||||
return new \WP_Error(
|
||||
|
@ -150,7 +150,7 @@ class Notes extends \WC_REST_CRUD_Controller {
|
|||
public function get_items( $request ) {
|
||||
$query_args = $this->prepare_objects_query( $request );
|
||||
|
||||
$notes = WC_Admin_Notes::get_notes( 'edit', $query_args );
|
||||
$notes = NotesRepository::get_notes( 'edit', $query_args );
|
||||
|
||||
$data = array();
|
||||
foreach ( (array) $notes as $note_obj ) {
|
||||
|
@ -160,7 +160,7 @@ class Notes extends \WC_REST_CRUD_Controller {
|
|||
}
|
||||
|
||||
$response = rest_ensure_response( $data );
|
||||
$response->header( 'X-WP-Total', WC_Admin_Notes::get_notes_count( $query_args['type'], $query_args['status'] ) );
|
||||
$response->header( 'X-WP-Total', NotesRepository::get_notes_count( $query_args['type'], $query_args['status'] ) );
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
@ -234,7 +234,7 @@ class Notes extends \WC_REST_CRUD_Controller {
|
|||
* @return WP_REST_Request|WP_Error
|
||||
*/
|
||||
public function update_item( $request ) {
|
||||
$note = WC_Admin_Notes::get_note( $request->get_param( 'id' ) );
|
||||
$note = NotesRepository::get_note( $request->get_param( 'id' ) );
|
||||
|
||||
if ( ! $note ) {
|
||||
return new \WP_Error(
|
||||
|
@ -244,7 +244,7 @@ class Notes extends \WC_REST_CRUD_Controller {
|
|||
);
|
||||
}
|
||||
|
||||
WC_Admin_Notes::update_note( $note, $this->get_requested_updates( $request ) );
|
||||
NotesRepository::update_note( $note, $this->get_requested_updates( $request ) );
|
||||
return $this->get_item( $request );
|
||||
}
|
||||
|
||||
|
@ -255,7 +255,7 @@ class Notes extends \WC_REST_CRUD_Controller {
|
|||
* @return WP_REST_Request|WP_Error
|
||||
*/
|
||||
public function delete_item( $request ) {
|
||||
$note = WC_Admin_Notes::get_note( $request->get_param( 'id' ) );
|
||||
$note = NotesRepository::get_note( $request->get_param( 'id' ) );
|
||||
|
||||
if ( ! $note ) {
|
||||
return new \WP_Error(
|
||||
|
@ -265,7 +265,7 @@ class Notes extends \WC_REST_CRUD_Controller {
|
|||
);
|
||||
}
|
||||
|
||||
WC_Admin_Notes::delete_note( $note );
|
||||
NotesRepository::delete_note( $note );
|
||||
$data = $this->prepare_note_data_for_response( $note, $request );
|
||||
return rest_ensure_response( $data );
|
||||
}
|
||||
|
@ -277,22 +277,23 @@ class Notes extends \WC_REST_CRUD_Controller {
|
|||
* @return WP_REST_Request|WP_Error
|
||||
*/
|
||||
public function delete_all_items( $request ) {
|
||||
$notes = WC_Admin_Notes::delete_all_notes();
|
||||
$notes = NotesRepository::delete_all_notes();
|
||||
$data = array();
|
||||
foreach ( (array) $notes as $note_obj ) {
|
||||
$data[] = $this->prepare_note_data_for_response( $note_obj, $request );
|
||||
}
|
||||
|
||||
$response = rest_ensure_response( $data );
|
||||
$response->header( 'X-WP-Total', WC_Admin_Notes::get_notes_count( array( 'info', 'warning' ), array() ) );
|
||||
$response->header( 'X-WP-Total', NotesRepository::get_notes_count( array( 'info', 'warning' ), array() ) );
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare note data.
|
||||
*
|
||||
* @param WC_Admin_Note $note Note data.
|
||||
* @param Note $note Note data.
|
||||
* @param WP_REST_Request $request Request object.
|
||||
*
|
||||
* @return WP_REST_Response $response Response data.
|
||||
*/
|
||||
public function prepare_note_data_for_response( $note, $request ) {
|
||||
|
@ -353,15 +354,15 @@ class Notes extends \WC_REST_CRUD_Controller {
|
|||
}
|
||||
|
||||
foreach ( (array) $note_ids as $note_id ) {
|
||||
$note = WC_Admin_Notes::get_note( (int) $note_id );
|
||||
$note = NotesRepository::get_note( (int) $note_id );
|
||||
if ( $note ) {
|
||||
WC_Admin_Notes::update_note( $note, $this->get_requested_updates( $request ) );
|
||||
NotesRepository::update_note( $note, $this->get_requested_updates( $request ) );
|
||||
$data[] = $this->prepare_note_data_for_response( $note, $request );
|
||||
}
|
||||
}
|
||||
|
||||
$response = rest_ensure_response( $data );
|
||||
$response->header( 'X-WP-Total', WC_Admin_Notes::get_notes_count( array( 'info', 'warning' ), array() ) );
|
||||
$response->header( 'X-WP-Total', NotesRepository::get_notes_count( array( 'info', 'warning' ), array() ) );
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
@ -501,7 +502,7 @@ class Notes extends \WC_REST_CRUD_Controller {
|
|||
'sanitize_callback' => 'wp_parse_slug_list',
|
||||
'validate_callback' => 'rest_validate_request_arg',
|
||||
'items' => array(
|
||||
'enum' => WC_Admin_Note::get_allowed_types(),
|
||||
'enum' => Note::get_allowed_types(),
|
||||
'type' => 'string',
|
||||
),
|
||||
);
|
||||
|
@ -511,7 +512,7 @@ class Notes extends \WC_REST_CRUD_Controller {
|
|||
'sanitize_callback' => 'wp_parse_slug_list',
|
||||
'validate_callback' => 'rest_validate_request_arg',
|
||||
'items' => array(
|
||||
'enum' => WC_Admin_Note::get_allowed_statuses(),
|
||||
'enum' => Note::get_allowed_statuses(),
|
||||
'type' => 'string',
|
||||
),
|
||||
);
|
||||
|
|
|
@ -9,7 +9,7 @@ namespace Automattic\WooCommerce\Admin\API;
|
|||
|
||||
use Automattic\WooCommerce\Admin\Features\Onboarding;
|
||||
use Automattic\WooCommerce\Admin\PluginsHelper;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Install_JP_And_WCS_Plugins;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Install_JP_And_WCS_Plugins;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
|
@ -194,7 +194,7 @@ class Plugins extends \WC_REST_Data_Controller {
|
|||
return;
|
||||
}
|
||||
|
||||
WC_Admin_Notes_Install_JP_And_WCS_Plugins::possibly_add_note();
|
||||
Install_JP_And_WCS_Plugins::possibly_add_note();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -0,0 +1,81 @@
|
|||
<?php
|
||||
/**
|
||||
* A facade to allow deprecating an entire class. Calling instance or static
|
||||
* functions on the facade triggers a deprecation notice before calling the
|
||||
* underlying function.
|
||||
*
|
||||
* Use it by extending DeprecatedClassFacade in your facade class, setting the
|
||||
* static $facade_over_classname string to the name of the class to build
|
||||
* a facade over, and setting the static $deprecated_in_version to the version
|
||||
* that the class was deprecated in. Eg.:
|
||||
*
|
||||
* class DeprecatedGoose extends DeprecatedClassFacade {
|
||||
* static $facade_over_classname = 'Goose';
|
||||
* static $deprecated_in_version = '1.6.0';
|
||||
* }
|
||||
*/
|
||||
|
||||
namespace Automattic\WooCommerce\Admin;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
|
||||
/**
|
||||
* A facade to allow deprecating an entire class.
|
||||
*/
|
||||
class DeprecatedClassFacade {
|
||||
/**
|
||||
* The instance that this facade covers over.
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
private $instance;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->instance = new static::$facade_over_classname();
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes when calling any function on an instance of this class.
|
||||
*
|
||||
* @param string $name The name of the function being called.
|
||||
* @param array $arguments An array of the arguments to the function call.
|
||||
*/
|
||||
public function __call( $name, $arguments ) {
|
||||
_deprecated_function(
|
||||
static::$facade_over_classname . '::' . $name,
|
||||
static::$deprecated_in_version
|
||||
);
|
||||
call_user_func_array(
|
||||
array(
|
||||
$this->instance,
|
||||
$name,
|
||||
),
|
||||
$arguments
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes when calling any static function on this class.
|
||||
*
|
||||
* @param string $name The name of the function being called.
|
||||
* @param array $arguments An array of the arguments to the function call.
|
||||
*/
|
||||
public static function __callStatic( $name, $arguments ) {
|
||||
_deprecated_function(
|
||||
static::$facade_over_classname . '::' . $name,
|
||||
static::$deprecated_in_version
|
||||
);
|
||||
call_user_func_array(
|
||||
array(
|
||||
static::$facade_over_classname,
|
||||
$name,
|
||||
),
|
||||
$arguments
|
||||
);
|
||||
}
|
||||
}
|
|
@ -8,36 +8,36 @@ namespace Automattic\WooCommerce\Admin;
|
|||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Choose_Niche;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Giving_Feedback_Notes;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Mobile_App;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_New_Sales_Record;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Tracking_Opt_In;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Onboarding_Email_Marketing;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Onboarding_Payments;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Personalize_Store;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_EU_VAT_Number;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_WooCommerce_Payments;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Marketing;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Start_Dropshipping_Business;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_WooCommerce_Subscriptions;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Migrate_From_Shopify;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Launch_Checklist;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Real_Time_Order_Alerts;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Choose_Niche;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Giving_Feedback_Notes;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Mobile_App;
|
||||
use \Automattic\WooCommerce\Admin\Notes\New_Sales_Record;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Tracking_Opt_In;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Onboarding_Email_Marketing;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Onboarding_Payments;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Personalize_Store;
|
||||
use \Automattic\WooCommerce\Admin\Notes\EU_VAT_Number;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WooCommerce_Payments;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Marketing;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Start_Dropshipping_Business;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WooCommerce_Subscriptions;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Migrate_From_Shopify;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Launch_Checklist;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Real_Time_Order_Alerts;
|
||||
use \Automattic\WooCommerce\Admin\RemoteInboxNotifications\DataSourcePoller;
|
||||
use \Automattic\WooCommerce\Admin\RemoteInboxNotifications\RemoteInboxNotificationsEngine;
|
||||
use \Automattic\WooCommerce\Admin\Loader;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Insight_First_Sale;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Home_Screen_Feedback;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Need_Some_Inspiration;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Learn_More_About_Product_Settings;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Online_Clothing_Store;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_First_Product;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Customize_Store_With_Blocks;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Google_Ads_And_Marketing;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Test_Checkout;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Edit_Products_On_The_Move;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Performance_On_Mobile;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Insight_First_Sale;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Home_Screen_Feedback;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Need_Some_Inspiration;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Learn_More_About_Product_Settings;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Online_Clothing_Store;
|
||||
use \Automattic\WooCommerce\Admin\Notes\First_Product;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Customize_Store_With_Blocks;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Google_Ads_And_Marketing;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Test_Checkout;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Edit_Products_On_The_Move;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Performance_On_Mobile;
|
||||
|
||||
/**
|
||||
* WC_Admin_Events Class.
|
||||
|
@ -79,36 +79,36 @@ class Events {
|
|||
/**
|
||||
* Daily events to run.
|
||||
*
|
||||
* Note: WC_Admin_Notes_Order_Milestones::other_milestones is hooked to this as well.
|
||||
* Note: Order_Milestones::other_milestones is hooked to this as well.
|
||||
*/
|
||||
public function do_wc_admin_daily() {
|
||||
WC_Admin_Notes_New_Sales_Record::possibly_add_note();
|
||||
WC_Admin_Notes_Mobile_App::possibly_add_note();
|
||||
WC_Admin_Notes_Tracking_Opt_In::possibly_add_note();
|
||||
WC_Admin_Notes_Onboarding_Email_Marketing::possibly_add_note();
|
||||
WC_Admin_Notes_Onboarding_Payments::possibly_add_note();
|
||||
WC_Admin_Notes_Personalize_Store::possibly_add_note();
|
||||
WC_Admin_Notes_WooCommerce_Payments::possibly_add_note();
|
||||
WC_Admin_Notes_EU_VAT_Number::possibly_add_note();
|
||||
WC_Admin_Notes_Marketing::possibly_add_note();
|
||||
WC_Admin_Notes_Giving_Feedback_Notes::possibly_add_note();
|
||||
WC_Admin_Notes_Start_Dropshipping_Business::possibly_add_note();
|
||||
WC_Admin_Notes_WooCommerce_Subscriptions::possibly_add_note();
|
||||
WC_Admin_Notes_Migrate_From_Shopify::possibly_add_note();
|
||||
WC_Admin_Notes_Insight_First_Sale::possibly_add_note();
|
||||
WC_Admin_Notes_Launch_Checklist::possibly_add_note();
|
||||
WC_Admin_Notes_Home_Screen_Feedback::possibly_add_note();
|
||||
WC_Admin_Notes_Need_Some_Inspiration::possibly_add_note();
|
||||
WC_Admin_Notes_Learn_More_About_Product_Settings::possibly_add_note();
|
||||
WC_Admin_Notes_Online_Clothing_Store::possibly_add_note();
|
||||
WC_Admin_Notes_First_Product::possibly_add_note();
|
||||
WC_Admin_Notes_Choose_Niche::possibly_add_note();
|
||||
WC_Admin_Notes_Real_Time_Order_Alerts::possibly_add_note();
|
||||
WC_Admin_Notes_Customize_Store_With_Blocks::possibly_add_note();
|
||||
WC_Admin_Notes_Google_Ads_And_Marketing::possibly_add_note();
|
||||
WC_Admin_Notes_Test_Checkout::possibly_add_note();
|
||||
WC_Admin_Notes_Edit_Products_On_The_Move::possibly_add_note();
|
||||
WC_Admin_Notes_Performance_On_Mobile::possibly_add_note();
|
||||
New_Sales_Record::possibly_add_note();
|
||||
Mobile_App::possibly_add_note();
|
||||
Tracking_Opt_In::possibly_add_note();
|
||||
Onboarding_Email_Marketing::possibly_add_note();
|
||||
Onboarding_Payments::possibly_add_note();
|
||||
Personalize_Store::possibly_add_note();
|
||||
WooCommerce_Payments::possibly_add_note();
|
||||
EU_VAT_Number::possibly_add_note();
|
||||
Marketing::possibly_add_note();
|
||||
Giving_Feedback_Notes::possibly_add_note();
|
||||
Start_Dropshipping_Business::possibly_add_note();
|
||||
WooCommerce_Subscriptions::possibly_add_note();
|
||||
Migrate_From_Shopify::possibly_add_note();
|
||||
Insight_First_Sale::possibly_add_note();
|
||||
Launch_Checklist::possibly_add_note();
|
||||
Home_Screen_Feedback::possibly_add_note();
|
||||
Need_Some_Inspiration::possibly_add_note();
|
||||
Learn_More_About_Product_Settings::possibly_add_note();
|
||||
Online_Clothing_Store::possibly_add_note();
|
||||
First_Product::possibly_add_note();
|
||||
Choose_Niche::possibly_add_note();
|
||||
Real_Time_Order_Alerts::possibly_add_note();
|
||||
Customize_Store_With_Blocks::possibly_add_note();
|
||||
Google_Ads_And_Marketing::possibly_add_note();
|
||||
Test_Checkout::possibly_add_note();
|
||||
Edit_Products_On_The_Move::possibly_add_note();
|
||||
Performance_On_Mobile::possibly_add_note();
|
||||
|
||||
if ( $this->is_remote_inbox_notifications_enabled() ) {
|
||||
DataSourcePoller::read_specs_from_data_sources();
|
||||
|
|
|
@ -7,20 +7,20 @@ namespace Automattic\WooCommerce\Admin;
|
|||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Historical_Data;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Order_Milestones;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Woo_Subscriptions_Notes;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Tracking_Opt_In;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_WooCommerce_Payments;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Install_JP_And_WCS_Plugins;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Draw_Attention;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Coupon_Page_Moved;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Notes;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Historical_Data;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Order_Milestones;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Woo_Subscriptions_Notes;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Tracking_Opt_In;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WooCommerce_Payments;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Install_JP_And_WCS_Plugins;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Draw_Attention;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Coupon_Page_Moved;
|
||||
use \Automattic\WooCommerce\Admin\RemoteInboxNotifications\RemoteInboxNotificationsEngine;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Home_Screen_Feedback;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Set_Up_Additional_Payment_Types;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Test_Checkout;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Selling_Online_Courses;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Home_Screen_Feedback;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Set_Up_Additional_Payment_Types;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Test_Checkout;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Selling_Online_Courses;
|
||||
|
||||
/**
|
||||
* Feature plugin main class.
|
||||
|
@ -118,7 +118,7 @@ class FeaturePlugin {
|
|||
|
||||
$this->includes();
|
||||
ReportsSync::clear_queued_actions();
|
||||
WC_Admin_Notes::clear_queued_actions();
|
||||
Notes::clear_queued_actions();
|
||||
wp_clear_scheduled_hook( 'wc_admin_daily' );
|
||||
wp_clear_scheduled_hook( 'generate_category_lookup_table' );
|
||||
}
|
||||
|
@ -174,24 +174,24 @@ class FeaturePlugin {
|
|||
ReportExporter::init();
|
||||
|
||||
// CRUD classes.
|
||||
WC_Admin_Notes::init();
|
||||
Notes::init();
|
||||
|
||||
// Initialize category lookup.
|
||||
CategoryLookup::instance()->init();
|
||||
|
||||
// Admin note providers.
|
||||
// @todo These should be bundled in the features/ folder, but loading them from there currently has a load order issue.
|
||||
new WC_Admin_Notes_Woo_Subscriptions_Notes();
|
||||
new WC_Admin_Notes_Historical_Data();
|
||||
new WC_Admin_Notes_Order_Milestones();
|
||||
new WC_Admin_Notes_Tracking_Opt_In();
|
||||
new WC_Admin_Notes_WooCommerce_Payments();
|
||||
new WC_Admin_Notes_Install_JP_And_WCS_Plugins();
|
||||
new WC_Admin_Notes_Draw_Attention();
|
||||
new WC_Admin_Notes_Home_Screen_Feedback();
|
||||
new WC_Admin_Notes_Set_Up_Additional_Payment_Types();
|
||||
new WC_Admin_Notes_Test_Checkout();
|
||||
new WC_Admin_Notes_Selling_Online_Courses();
|
||||
new Woo_Subscriptions_Notes();
|
||||
new Historical_Data();
|
||||
new Order_Milestones();
|
||||
new Tracking_Opt_In();
|
||||
new WooCommerce_Payments();
|
||||
new Install_JP_And_WCS_Plugins();
|
||||
new Draw_Attention();
|
||||
new Home_Screen_Feedback();
|
||||
new Set_Up_Additional_Payment_Types();
|
||||
new Test_Checkout();
|
||||
new Selling_Online_Courses();
|
||||
|
||||
// Initialize RemoteInboxNotificationsEngine.
|
||||
RemoteInboxNotificationsEngine::init();
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
namespace Automattic\WooCommerce\Admin\Features;
|
||||
|
||||
use Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes;
|
||||
use Automattic\WooCommerce\Admin\Notes\Notes;
|
||||
|
||||
/**
|
||||
* Contains backend logic for the activity panel feature.
|
||||
|
@ -109,7 +109,7 @@ class ActivityPanels {
|
|||
* @param array $settings Component settings.
|
||||
*/
|
||||
public function component_settings( $settings ) {
|
||||
$settings['alertCount'] = WC_Admin_Notes::get_notes_count( array( 'error', 'update' ), array( 'unactioned' ) );
|
||||
$settings['alertCount'] = Notes::get_notes_count( array( 'error', 'update' ), array( 'unactioned' ) );
|
||||
$settings['hasLowStock'] = $this->has_low_stock_products();
|
||||
return $settings;
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
namespace Automattic\WooCommerce\Admin\Features;
|
||||
|
||||
use Automattic\WooCommerce\Admin\Loader;
|
||||
use Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Coupon_Page_Moved;
|
||||
use Automattic\WooCommerce\Admin\Notes\Coupon_Page_Moved;
|
||||
use Automattic\WooCommerce\Admin\PageController;
|
||||
|
||||
/**
|
||||
|
@ -53,7 +53,7 @@ class Coupons {
|
|||
return;
|
||||
}
|
||||
|
||||
( new WC_Admin_Notes_Coupon_Page_Moved() )->init();
|
||||
( new Coupon_Page_Moved() )->init();
|
||||
|
||||
add_action( 'admin_enqueue_scripts', array( $this, 'maybe_add_marketing_coupon_script' ) );
|
||||
add_action( 'woocommerce_register_post_type_shop_coupon', array( $this, 'move_coupons' ) );
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
namespace Automattic\WooCommerce\Admin\Features;
|
||||
|
||||
use \Automattic\WooCommerce\Admin\Loader;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Onboarding_Profiler;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Onboarding_Profiler;
|
||||
use \Automattic\WooCommerce\Admin\PluginsHelper;
|
||||
use \Automattic\WooCommerce\Admin\Features\OnboardingSetUpShipping;
|
||||
use \Automattic\WooCommerce\Admin\Features\OnboardingAutomateTaxes;
|
||||
|
@ -64,7 +64,7 @@ class Onboarding {
|
|||
}
|
||||
|
||||
// Add onboarding notes.
|
||||
new WC_Admin_Notes_Onboarding_Profiler();
|
||||
new Onboarding_Profiler();
|
||||
|
||||
// Add actions and filters.
|
||||
$this->add_actions();
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
namespace Automattic\WooCommerce\Admin\Features;
|
||||
|
||||
use \Automattic\WooCommerce\Admin\PluginsHelper;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Review_Shipping_Settings;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Review_Shipping_Settings;
|
||||
|
||||
/**
|
||||
* This contains logic for setting up shipping when the profiler completes.
|
||||
|
@ -40,7 +40,7 @@ class OnboardingSetUpShipping {
|
|||
}
|
||||
|
||||
self::set_up_free_local_shipping();
|
||||
WC_Admin_Notes_Review_Shipping_Settings::possibly_add_note();
|
||||
Review_Shipping_Settings::possibly_add_note();
|
||||
wc_admin_record_tracks_event( 'shipping_automatically_set_up' );
|
||||
}
|
||||
|
||||
|
|
|
@ -8,8 +8,8 @@ namespace Automattic\WooCommerce\Admin;
|
|||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
use Automattic\WooCommerce\Admin\API\Reports\Cache;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Historical_Data;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Notes;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Historical_Data;
|
||||
|
||||
/**
|
||||
* Install Class.
|
||||
|
@ -485,14 +485,14 @@ class Install {
|
|||
);
|
||||
}
|
||||
|
||||
WC_Admin_Notes::delete_notes_with_name( $obsolete_notes_names );
|
||||
Notes::delete_notes_with_name( $obsolete_notes_names );
|
||||
}
|
||||
|
||||
/**
|
||||
* Create notes.
|
||||
*/
|
||||
protected static function create_notes() {
|
||||
WC_Admin_Notes_Historical_Data::possibly_add_note();
|
||||
Historical_Data::possibly_add_note();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -10,9 +10,9 @@ namespace Automattic\WooCommerce\Admin\Notes;
|
|||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Choose_Niche.
|
||||
* Choose_Niche.
|
||||
*/
|
||||
class WC_Admin_Notes_Choose_Niche {
|
||||
class Choose_Niche {
|
||||
/**
|
||||
* Note traits.
|
||||
*/
|
||||
|
@ -25,6 +25,8 @@ class WC_Admin_Notes_Choose_Niche {
|
|||
|
||||
/**
|
||||
* Get the note.
|
||||
*
|
||||
* @return Note
|
||||
*/
|
||||
public static function get_note() {
|
||||
$onboarding_profile = get_option( 'woocommerce_onboarding_profile', array() );
|
||||
|
@ -61,10 +63,10 @@ class WC_Admin_Notes_Choose_Niche {
|
|||
return;
|
||||
}
|
||||
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
$note->set_title( __( 'How to choose a niche for your online store', 'woocommerce-admin' ) );
|
||||
$note->set_content( __( 'Your niche defines the products and services you develop. It directs your marketing. It focuses your attention on specific problems facing your customers. It differentiates you from the competition. Learn more about the five guiding principles to define your niche.', 'woocommerce-admin' ) );
|
||||
$note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_name( self::NOTE_NAME );
|
||||
$note->set_content_data( (object) array() );
|
||||
$note->set_source( 'woocommerce-admin' );
|
||||
|
@ -72,7 +74,7 @@ class WC_Admin_Notes_Choose_Niche {
|
|||
'choose-niche',
|
||||
__( 'Learn more', 'woocommerce-admin' ),
|
||||
'https://woocommerce.com/posts/how-to-choose-a-niche-online-business/?utm_source=inbox',
|
||||
WC_Admin_Note::E_WC_ADMIN_NOTE_ACTIONED,
|
||||
Note::E_WC_ADMIN_NOTE_ACTIONED,
|
||||
true
|
||||
);
|
||||
return $note;
|
|
@ -14,9 +14,9 @@ use WC_Data_Store;
|
|||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Coupon_Page_Moved class.
|
||||
* Coupon_Page_Moved class.
|
||||
*/
|
||||
class WC_Admin_Notes_Coupon_Page_Moved {
|
||||
class Coupon_Page_Moved {
|
||||
|
||||
use NoteTraits, CouponsMovedTrait;
|
||||
|
||||
|
@ -60,13 +60,13 @@ class WC_Admin_Notes_Coupon_Page_Moved {
|
|||
/**
|
||||
* Get the note object for this class.
|
||||
*
|
||||
* @return WC_Admin_Note
|
||||
* @return Note
|
||||
*/
|
||||
public static function get_note() {
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
$note->set_title( __( 'Coupon management has moved!', 'woocommerce-admin' ) );
|
||||
$note->set_content( __( 'Coupons can now be managed from Marketing > Coupons. Click the button below to remove the legacy WooCommerce > Coupons menu item.', 'woocommerce-admin' ) );
|
||||
$note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_UPDATE );
|
||||
$note->set_type( Note::E_WC_ADMIN_NOTE_UPDATE );
|
||||
$note->set_name( self::NOTE_NAME );
|
||||
$note->set_content_data( new stdClass() );
|
||||
$note->set_source( 'woocommerce-admin' );
|
||||
|
@ -74,7 +74,7 @@ class WC_Admin_Notes_Coupon_Page_Moved {
|
|||
'remove-legacy-coupon-menu',
|
||||
__( 'Remove legacy coupon menu', 'woocommerce-admin' ),
|
||||
wc_admin_url( '&action=remove-coupon-menu' ),
|
||||
WC_Admin_Note::E_WC_ADMIN_NOTE_ACTIONED,
|
||||
Note::E_WC_ADMIN_NOTE_ACTIONED,
|
||||
true
|
||||
);
|
||||
|
|
@ -12,9 +12,9 @@ namespace Automattic\WooCommerce\Admin\Notes;
|
|||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Customize_Store_With_Blocks.
|
||||
* Customize_Store_With_Blocks.
|
||||
*/
|
||||
class WC_Admin_Notes_Customize_Store_With_Blocks {
|
||||
class Customize_Store_With_Blocks {
|
||||
/**
|
||||
* Note traits.
|
||||
*/
|
||||
|
@ -27,6 +27,8 @@ class WC_Admin_Notes_Customize_Store_With_Blocks {
|
|||
|
||||
/**
|
||||
* Get the note.
|
||||
*
|
||||
* @return Note
|
||||
*/
|
||||
public static function get_note() {
|
||||
$onboarding_profile = get_option( 'woocommerce_onboarding_profile', array() );
|
||||
|
@ -63,10 +65,10 @@ class WC_Admin_Notes_Customize_Store_With_Blocks {
|
|||
return;
|
||||
}
|
||||
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
$note->set_title( __( 'Customize your online store with WooCommerce blocks', 'woocommerce-admin' ) );
|
||||
$note->set_content( __( 'With our blocks, you can select and display products, categories, filters, and more virtually anywhere on your site — no need to use shortcodes or edit lines of code. Learn more about how to use each one of them.', 'woocommerce-admin' ) );
|
||||
$note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_name( self::NOTE_NAME );
|
||||
$note->set_content_data( (object) array() );
|
||||
$note->set_source( 'woocommerce-admin' );
|
||||
|
@ -74,7 +76,7 @@ class WC_Admin_Notes_Customize_Store_With_Blocks {
|
|||
'customize-store-with-blocks',
|
||||
__( 'Learn more', 'woocommerce-admin' ),
|
||||
'https://woocommerce.com/posts/how-to-customize-your-online-store-with-woocommerce-blocks/?utm_source=inbox',
|
||||
WC_Admin_Note::E_WC_ADMIN_NOTE_ACTIONED,
|
||||
Note::E_WC_ADMIN_NOTE_ACTIONED,
|
||||
true
|
||||
);
|
||||
return $note;
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* WC_Admin_Note_Data_Store class file.
|
||||
* WC Admin Note Data_Store class file.
|
||||
*/
|
||||
|
||||
namespace Automattic\WooCommerce\Admin\Notes;
|
||||
|
@ -14,7 +14,7 @@ class DataStore extends \WC_Data_Store_WP implements \WC_Object_Data_Store_Inter
|
|||
/**
|
||||
* Method to create a new note in the database.
|
||||
*
|
||||
* @param WC_Admin_Note $note Admin note.
|
||||
* @param Note $note Admin note.
|
||||
*/
|
||||
public function create( &$note ) {
|
||||
$date_created = time();
|
||||
|
@ -58,7 +58,7 @@ class DataStore extends \WC_Data_Store_WP implements \WC_Object_Data_Store_Inter
|
|||
/**
|
||||
* Method to read a note.
|
||||
*
|
||||
* @param WC_Admin_Note $note Admin note.
|
||||
* @param Note $note Admin note.
|
||||
* @throws \Exception Throws exception when invalid data is found.
|
||||
*/
|
||||
public function read( &$note ) {
|
||||
|
@ -129,7 +129,7 @@ class DataStore extends \WC_Data_Store_WP implements \WC_Object_Data_Store_Inter
|
|||
/**
|
||||
* Updates a note in the database.
|
||||
*
|
||||
* @param WC_Admin_Note $note Admin note.
|
||||
* @param Note $note Admin note.
|
||||
*/
|
||||
public function update( &$note ) {
|
||||
global $wpdb;
|
||||
|
@ -184,8 +184,8 @@ class DataStore extends \WC_Data_Store_WP implements \WC_Object_Data_Store_Inter
|
|||
/**
|
||||
* Deletes a note from the database.
|
||||
*
|
||||
* @param WC_Admin_Note $note Admin note.
|
||||
* @param array $args Array of args to pass to the delete method (not used).
|
||||
* @param Note $note Admin note.
|
||||
* @param array $args Array of args to pass to the delete method (not used).
|
||||
*/
|
||||
public function delete( &$note, $args = array() ) {
|
||||
$note_id = $note->get_id();
|
||||
|
@ -207,7 +207,7 @@ class DataStore extends \WC_Data_Store_WP implements \WC_Object_Data_Store_Inter
|
|||
/**
|
||||
* Read actions from the database.
|
||||
*
|
||||
* @param WC_Admin_Note $note Admin note.
|
||||
* @param Note $note Admin note.
|
||||
*/
|
||||
private function read_actions( &$note ) {
|
||||
global $wpdb;
|
||||
|
@ -244,7 +244,7 @@ class DataStore extends \WC_Data_Store_WP implements \WC_Object_Data_Store_Inter
|
|||
* Save actions to the database.
|
||||
* This function clears old actions, then re-inserts new if any changes are found.
|
||||
*
|
||||
* @param WC_Admin_Note $note Note object.
|
||||
* @param Note $note Note object.
|
||||
*
|
||||
* @return bool|void
|
||||
*/
|
||||
|
@ -259,7 +259,7 @@ class DataStore extends \WC_Data_Store_WP implements \WC_Object_Data_Store_Inter
|
|||
|
||||
// Process action removal. Actions are removed from
|
||||
// the note if they aren't part of the changeset.
|
||||
// See WC_Admin_Note::add_action().
|
||||
// See Note::add_action().
|
||||
$changed_actions = $note->get_actions( 'edit' );
|
||||
$actions_to_keep = array();
|
||||
|
||||
|
@ -380,7 +380,7 @@ class DataStore extends \WC_Data_Store_WP implements \WC_Object_Data_Store_Inter
|
|||
* @return string Where clauses for the query.
|
||||
*/
|
||||
public function get_notes_where_clauses( $args = array() ) {
|
||||
$allowed_types = WC_Admin_Note::get_allowed_types();
|
||||
$allowed_types = Note::get_allowed_types();
|
||||
$where_type_array = array();
|
||||
if ( isset( $args['type'] ) ) {
|
||||
foreach ( $args['type'] as $args_type ) {
|
||||
|
@ -391,7 +391,7 @@ class DataStore extends \WC_Data_Store_WP implements \WC_Object_Data_Store_Inter
|
|||
}
|
||||
}
|
||||
|
||||
$allowed_statuses = WC_Admin_Note::get_allowed_statuses();
|
||||
$allowed_statuses = Note::get_allowed_statuses();
|
||||
$where_status_array = array();
|
||||
if ( isset( $args['status'] ) ) {
|
||||
foreach ( $args['status'] as $args_status ) {
|
||||
|
|
|
@ -10,9 +10,9 @@ namespace Automattic\WooCommerce\Admin\Notes;
|
|||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Deactivate_Plugin.
|
||||
* Deactivate_Plugin.
|
||||
*/
|
||||
class WC_Admin_Notes_Deactivate_Plugin {
|
||||
class Deactivate_Plugin {
|
||||
/**
|
||||
* Note traits.
|
||||
*/
|
||||
|
@ -32,12 +32,14 @@ class WC_Admin_Notes_Deactivate_Plugin {
|
|||
|
||||
/**
|
||||
* Get the note.
|
||||
*
|
||||
* @return Note
|
||||
*/
|
||||
public static function get_note() {
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
$note->set_title( __( 'Deactivate old WooCommerce Admin version', 'woocommerce-admin' ) );
|
||||
$note->set_content( __( 'Your current version of WooCommerce Admin is outdated and a newer version is included with WooCommerce. We recommend deactivating the plugin and using the stable version included with WooCommerce.', 'woocommerce-admin' ) );
|
||||
$note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_name( self::NOTE_NAME );
|
||||
$note->set_content_data( (object) array() );
|
||||
$note->set_source( 'woocommerce-admin' );
|
||||
|
@ -45,7 +47,7 @@ class WC_Admin_Notes_Deactivate_Plugin {
|
|||
'deactivate-feature-plugin',
|
||||
__( 'Deactivate', 'woocommerce-admin' ),
|
||||
wc_admin_url( '&action=deactivate-feature-plugin' ),
|
||||
'unactioned',
|
||||
Note::E_WC_ADMIN_NOTE_UNACTIONED,
|
||||
true
|
||||
);
|
||||
return $note;
|
||||
|
@ -55,7 +57,7 @@ class WC_Admin_Notes_Deactivate_Plugin {
|
|||
* Delete the note if the version is higher than the included.
|
||||
*/
|
||||
public static function delete_note() {
|
||||
WC_Admin_Notes::delete_notes_with_name( self::NOTE_NAME );
|
||||
Notes::delete_notes_with_name( self::NOTE_NAME );
|
||||
}
|
||||
|
||||
/**
|
|
@ -0,0 +1,773 @@
|
|||
<?php
|
||||
/**
|
||||
* Define deprecated classes to support changing the naming convention of
|
||||
* admin notes.
|
||||
*/
|
||||
|
||||
namespace Automattic\WooCommerce\Admin\Notes;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
use Automattic\WooCommerce\Admin\DeprecatedClassFacade;
|
||||
|
||||
// phpcs:disable Generic.Files.OneObjectStructurePerFile.MultipleFound
|
||||
|
||||
/**
|
||||
* WC_Admin_Note (deprecated, use Note instead).
|
||||
*/
|
||||
class WC_Admin_Note extends DeprecatedClassFacade {
|
||||
/**
|
||||
* The name of the non-deprecated class that this facade covers.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\Note';
|
||||
|
||||
/**
|
||||
* The version that this class was deprecated in.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $deprecated_in_version = '1.6.0';
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes (deprecated, use Notes instead).
|
||||
*/
|
||||
class WC_Admin_Notes extends DeprecatedClassFacade {
|
||||
/**
|
||||
* The name of the non-deprecated class that this facade covers.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\Notes';
|
||||
|
||||
/**
|
||||
* The version that this class was deprecated in.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $deprecated_in_version = '1.6.0';
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Choose_Niche (deprecated, use Choose_Niche instead).
|
||||
*/
|
||||
class WC_Admin_Notes_Choose_Niche extends DeprecatedClassFacade {
|
||||
/**
|
||||
* The name of the non-deprecated class that this facade covers.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\Choose_Niche';
|
||||
|
||||
/**
|
||||
* The version that this class was deprecated in.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $deprecated_in_version = '1.6.0';
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Coupon_Page_Moved (deprecated, use Coupon_Page_Moved instead).
|
||||
*/
|
||||
class WC_Admin_Notes_Coupon_Page_Moved extends DeprecatedClassFacade {
|
||||
/**
|
||||
* The name of the non-deprecated class that this facade covers.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\Coupon_Page_Moved';
|
||||
|
||||
/**
|
||||
* The version that this class was deprecated in.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $deprecated_in_version = '1.6.0';
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Customize_Store_With_Blocks (deprecated, use Customize_Store_With_Blocks instead).
|
||||
*/
|
||||
class WC_Admin_Notes_Customize_Store_With_Blocks extends DeprecatedClassFacade {
|
||||
/**
|
||||
* The name of the non-deprecated class that this facade covers.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\Customize_Store_With_Blocks';
|
||||
|
||||
/**
|
||||
* The version that this class was deprecated in.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $deprecated_in_version = '1.6.0';
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Deactivate_Plugin (deprecated, use Deactivate_Plugin instead).
|
||||
*/
|
||||
class WC_Admin_Notes_Deactivate_Plugin extends DeprecatedClassFacade {
|
||||
/**
|
||||
* The name of the non-deprecated class that this facade covers.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\Deactivate_Plugin';
|
||||
|
||||
/**
|
||||
* The version that this class was deprecated in.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $deprecated_in_version = '1.6.0';
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Draw_Attention (deprecated, use Draw_Attention instead).
|
||||
*/
|
||||
class WC_Admin_Notes_Draw_Attention extends DeprecatedClassFacade {
|
||||
/**
|
||||
* The name of the non-deprecated class that this facade covers.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\Draw_Attention';
|
||||
|
||||
/**
|
||||
* The version that this class was deprecated in.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $deprecated_in_version = '1.6.0';
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Edit_Products_On_The_Move (deprecated, use Edit_Products_On_The_Move instead).
|
||||
*/
|
||||
class WC_Admin_Notes_Edit_Products_On_The_Move extends DeprecatedClassFacade {
|
||||
/**
|
||||
* The name of the non-deprecated class that this facade covers.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\Edit_Products_On_The_Move';
|
||||
|
||||
/**
|
||||
* The version that this class was deprecated in.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $deprecated_in_version = '1.6.0';
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_EU_VAT_Number (deprecated, use EU_VAT_Number instead).
|
||||
*/
|
||||
class WC_Admin_Notes_EU_VAT_Number extends DeprecatedClassFacade {
|
||||
/**
|
||||
* The name of the non-deprecated class that this facade covers.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\EU_VAT_Number';
|
||||
|
||||
/**
|
||||
* The version that this class was deprecated in.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $deprecated_in_version = '1.6.0';
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Facebook_Marketing_Expert (deprecated, use Facebook_Marketing_Expert instead).
|
||||
*/
|
||||
class WC_Admin_Notes_Facebook_Marketing_Expert extends DeprecatedClassFacade {
|
||||
/**
|
||||
* The name of the non-deprecated class that this facade covers.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\Facebook_Marketing_Expert';
|
||||
|
||||
/**
|
||||
* The version that this class was deprecated in.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $deprecated_in_version = '1.6.0';
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_First_Product (deprecated, use First_Product instead).
|
||||
*/
|
||||
class WC_Admin_Notes_First_Product extends DeprecatedClassFacade {
|
||||
/**
|
||||
* The name of the non-deprecated class that this facade covers.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\First_Product';
|
||||
|
||||
/**
|
||||
* The version that this class was deprecated in.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $deprecated_in_version = '1.6.0';
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Giving_Feedback_Notes (deprecated, use Giving_Feedback_Notes instead).
|
||||
*/
|
||||
class WC_Admin_Notes_Giving_Feedback_Notes extends DeprecatedClassFacade {
|
||||
/**
|
||||
* The name of the non-deprecated class that this facade covers.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\Giving_Feedback_Notes';
|
||||
|
||||
/**
|
||||
* The version that this class was deprecated in.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $deprecated_in_version = '1.6.0';
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Historical_Data (deprecated, use Historical_Data instead).
|
||||
*/
|
||||
class WC_Admin_Notes_Historical_Data extends DeprecatedClassFacade {
|
||||
/**
|
||||
* The name of the non-deprecated class that this facade covers.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\Historical_Data';
|
||||
|
||||
/**
|
||||
* The version that this class was deprecated in.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $deprecated_in_version = '1.6.0';
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Home_Screen_Feedback (deprecated, use Home_Screen_Feedback instead).
|
||||
*/
|
||||
class WC_Admin_Notes_Home_Screen_Feedback extends DeprecatedClassFacade {
|
||||
/**
|
||||
* The name of the non-deprecated class that this facade covers.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\Home_Screen_Feedback';
|
||||
|
||||
/**
|
||||
* The version that this class was deprecated in.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $deprecated_in_version = '1.6.0';
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Insight_First_Sale (deprecated, use Insight_First_Sale instead).
|
||||
*/
|
||||
class WC_Admin_Notes_Insight_First_Sale extends DeprecatedClassFacade {
|
||||
/**
|
||||
* The name of the non-deprecated class that this facade covers.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\Insight_First_Sale';
|
||||
|
||||
/**
|
||||
* The version that this class was deprecated in.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $deprecated_in_version = '1.6.0';
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Install_JP_And_WCS_Plugins (deprecated, use Install_JP_And_WCS_Plugins instead).
|
||||
*/
|
||||
class WC_Admin_Notes_Install_JP_And_WCS_Plugins extends DeprecatedClassFacade {
|
||||
/**
|
||||
* The name of the non-deprecated class that this facade covers.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\Install_JP_And_WCS_Plugins';
|
||||
|
||||
/**
|
||||
* The version that this class was deprecated in.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $deprecated_in_version = '1.6.0';
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Launch_Checklist (deprecated, use Launch_Checklist instead).
|
||||
*/
|
||||
class WC_Admin_Notes_Launch_Checklist extends DeprecatedClassFacade {
|
||||
/**
|
||||
* The name of the non-deprecated class that this facade covers.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\Launch_Checklist';
|
||||
|
||||
/**
|
||||
* The version that this class was deprecated in.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $deprecated_in_version = '1.6.0';
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Learn_More_About_Product_Settings (deprecated, use Learn_More_About_Product_Settings instead).
|
||||
*/
|
||||
class WC_Admin_Notes_Learn_More_About_Product_Settings extends DeprecatedClassFacade {
|
||||
/**
|
||||
* The name of the non-deprecated class that this facade covers.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\Learn_More_About_Product_Settings';
|
||||
|
||||
/**
|
||||
* The version that this class was deprecated in.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $deprecated_in_version = '1.6.0';
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Marketing (deprecated, use Marketing instead).
|
||||
*/
|
||||
class WC_Admin_Notes_Marketing extends DeprecatedClassFacade {
|
||||
/**
|
||||
* The name of the non-deprecated class that this facade covers.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\Marketing';
|
||||
|
||||
/**
|
||||
* The version that this class was deprecated in.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $deprecated_in_version = '1.6.0';
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Migrate_From_Shopify (deprecated, use Migrate_From_Shopify instead).
|
||||
*/
|
||||
class WC_Admin_Notes_Migrate_From_Shopify extends DeprecatedClassFacade {
|
||||
/**
|
||||
* The name of the non-deprecated class that this facade covers.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\Migrate_From_Shopify';
|
||||
|
||||
/**
|
||||
* The version that this class was deprecated in.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $deprecated_in_version = '1.6.0';
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Mobile_App (deprecated, use Mobile_App instead).
|
||||
*/
|
||||
class WC_Admin_Notes_Mobile_App extends DeprecatedClassFacade {
|
||||
/**
|
||||
* The name of the non-deprecated class that this facade covers.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\Mobile_App';
|
||||
|
||||
/**
|
||||
* The version that this class was deprecated in.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $deprecated_in_version = '1.6.0';
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Need_Some_Inspiration (deprecated, use Need_Some_Inspiration instead).
|
||||
*/
|
||||
class WC_Admin_Notes_Need_Some_Inspiration extends DeprecatedClassFacade {
|
||||
/**
|
||||
* The name of the non-deprecated class that this facade covers.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\Need_Some_Inspiration';
|
||||
|
||||
/**
|
||||
* The version that this class was deprecated in.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $deprecated_in_version = '1.6.0';
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_New_Sales_Record (deprecated, use New_Sales_Record instead).
|
||||
*/
|
||||
class WC_Admin_Notes_New_Sales_Record extends DeprecatedClassFacade {
|
||||
/**
|
||||
* The name of the non-deprecated class that this facade covers.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\New_Sales_Record';
|
||||
|
||||
/**
|
||||
* The version that this class was deprecated in.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $deprecated_in_version = '1.6.0';
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Onboarding_Email_Marketing (deprecated, use Onboarding_Email_Marketing instead).
|
||||
*/
|
||||
class WC_Admin_Notes_Onboarding_Email_Marketing extends DeprecatedClassFacade {
|
||||
/**
|
||||
* The name of the non-deprecated class that this facade covers.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\Onboarding_Email_Marketing';
|
||||
|
||||
/**
|
||||
* The version that this class was deprecated in.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $deprecated_in_version = '1.6.0';
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Onboarding_Payments (deprecated, use Onboarding_Payments instead).
|
||||
*/
|
||||
class WC_Admin_Notes_Onboarding_Payments extends DeprecatedClassFacade {
|
||||
/**
|
||||
* The name of the non-deprecated class that this facade covers.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\Onboarding_Payments';
|
||||
|
||||
/**
|
||||
* The version that this class was deprecated in.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $deprecated_in_version = '1.6.0';
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Onboarding_Profiler (deprecated, use Onboarding_Profiler instead).
|
||||
*/
|
||||
class WC_Admin_Notes_Onboarding_Profiler extends DeprecatedClassFacade {
|
||||
/**
|
||||
* The name of the non-deprecated class that this facade covers.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\Onboarding_Profiler';
|
||||
|
||||
/**
|
||||
* The version that this class was deprecated in.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $deprecated_in_version = '1.6.0';
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Online_Clothing_Store (deprecated, use Online_Clothing_Store instead).
|
||||
*/
|
||||
class WC_Admin_Notes_Online_Clothing_Store extends DeprecatedClassFacade {
|
||||
/**
|
||||
* The name of the non-deprecated class that this facade covers.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\Online_Clothing_Store';
|
||||
|
||||
/**
|
||||
* The version that this class was deprecated in.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $deprecated_in_version = '1.6.0';
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Order_Milestones (deprecated, use Order_Milestones instead).
|
||||
*/
|
||||
class WC_Admin_Notes_Order_Milestones extends DeprecatedClassFacade {
|
||||
/**
|
||||
* The name of the non-deprecated class that this facade covers.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\Order_Milestones';
|
||||
|
||||
/**
|
||||
* The version that this class was deprecated in.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $deprecated_in_version = '1.6.0';
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Performance_On_Mobile (deprecated, use Performance_On_Mobile instead).
|
||||
*/
|
||||
class WC_Admin_Notes_Performance_On_Mobile extends DeprecatedClassFacade {
|
||||
/**
|
||||
* The name of the non-deprecated class that this facade covers.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\Performance_On_Mobile';
|
||||
|
||||
/**
|
||||
* The version that this class was deprecated in.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $deprecated_in_version = '1.6.0';
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Personalize_Store (deprecated, use Personalize_Store instead).
|
||||
*/
|
||||
class WC_Admin_Notes_Personalize_Store extends DeprecatedClassFacade {
|
||||
/**
|
||||
* The name of the non-deprecated class that this facade covers.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\Personalize_Store';
|
||||
|
||||
/**
|
||||
* The version that this class was deprecated in.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $deprecated_in_version = '1.6.0';
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Real_Time_Order_Alerts (deprecated, use Real_Time_Order_Alerts instead).
|
||||
*/
|
||||
class WC_Admin_Notes_Real_Time_Order_Alerts extends DeprecatedClassFacade {
|
||||
/**
|
||||
* The name of the non-deprecated class that this facade covers.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\Real_Time_Order_Alerts';
|
||||
|
||||
/**
|
||||
* The version that this class was deprecated in.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $deprecated_in_version = '1.6.0';
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Review_Shipping_Settings (deprecated, use Review_Shipping_Settings instead).
|
||||
*/
|
||||
class WC_Admin_Notes_Review_Shipping_Settings extends DeprecatedClassFacade {
|
||||
/**
|
||||
* The name of the non-deprecated class that this facade covers.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\Review_Shipping_Settings';
|
||||
|
||||
/**
|
||||
* The version that this class was deprecated in.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $deprecated_in_version = '1.6.0';
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Selling_Online_Courses (deprecated, use Selling_Online_Courses instead).
|
||||
*/
|
||||
class WC_Admin_Notes_Selling_Online_Courses extends DeprecatedClassFacade {
|
||||
/**
|
||||
* The name of the non-deprecated class that this facade covers.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\Selling_Online_Courses';
|
||||
|
||||
/**
|
||||
* The version that this class was deprecated in.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $deprecated_in_version = '1.6.0';
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Set_Up_Additional_Payment_Types (deprecated, use Set_Up_Additional_Payment_Types instead).
|
||||
*/
|
||||
class WC_Admin_Notes_Set_Up_Additional_Payment_Types extends DeprecatedClassFacade {
|
||||
/**
|
||||
* The name of the non-deprecated class that this facade covers.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\Set_Up_Additional_Payment_Types';
|
||||
|
||||
/**
|
||||
* The version that this class was deprecated in.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $deprecated_in_version = '1.6.0';
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Start_Dropshipping_Business (deprecated, use Start_Dropshipping_Business instead).
|
||||
*/
|
||||
class WC_Admin_Notes_Start_Dropshipping_Business extends DeprecatedClassFacade {
|
||||
/**
|
||||
* The name of the non-deprecated class that this facade covers.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\Start_Dropshipping_Business';
|
||||
|
||||
/**
|
||||
* The version that this class was deprecated in.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $deprecated_in_version = '1.6.0';
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Test_Checkout (deprecated, use Test_Checkout instead).
|
||||
*/
|
||||
class WC_Admin_Notes_Test_Checkout extends DeprecatedClassFacade {
|
||||
/**
|
||||
* The name of the non-deprecated class that this facade covers.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\Test_Checkout';
|
||||
|
||||
/**
|
||||
* The version that this class was deprecated in.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $deprecated_in_version = '1.6.0';
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Tracking_Opt_In (deprecated, use Tracking_Opt_In instead).
|
||||
*/
|
||||
class WC_Admin_Notes_Tracking_Opt_In extends DeprecatedClassFacade {
|
||||
/**
|
||||
* The name of the non-deprecated class that this facade covers.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\Tracking_Opt_In';
|
||||
|
||||
/**
|
||||
* The version that this class was deprecated in.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $deprecated_in_version = '1.6.0';
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Woo_Subscriptions_Notes (deprecated, use Woo_Subscriptions_Notes instead).
|
||||
*/
|
||||
class WC_Admin_Notes_Woo_Subscriptions_Notes extends DeprecatedClassFacade {
|
||||
/**
|
||||
* The name of the non-deprecated class that this facade covers.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\Woo_Subscriptions_Notes';
|
||||
|
||||
/**
|
||||
* The version that this class was deprecated in.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $deprecated_in_version = '1.6.0';
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_WooCommerce_Payments (deprecated, use WooCommerce_Payments instead).
|
||||
*/
|
||||
class WC_Admin_Notes_WooCommerce_Payments extends DeprecatedClassFacade {
|
||||
/**
|
||||
* The name of the non-deprecated class that this facade covers.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\WooCommerce_Payments';
|
||||
|
||||
/**
|
||||
* The version that this class was deprecated in.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $deprecated_in_version = '1.6.0';
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_WooCommerce_Subscriptions (deprecated, use WooCommerce_Subscriptions instead).
|
||||
*/
|
||||
class WC_Admin_Notes_WooCommerce_Subscriptions extends DeprecatedClassFacade {
|
||||
/**
|
||||
* The name of the non-deprecated class that this facade covers.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\WooCommerce_Subscriptions';
|
||||
|
||||
/**
|
||||
* The version that this class was deprecated in.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $deprecated_in_version = '1.6.0';
|
||||
}
|
|
@ -12,9 +12,9 @@ use \Automattic\WooCommerce\Admin\Features\Onboarding;
|
|||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Draw_Attention
|
||||
* Draw_Attention
|
||||
*/
|
||||
class WC_Admin_Notes_Draw_Attention {
|
||||
class Draw_Attention {
|
||||
/**
|
||||
* Note traits.
|
||||
*/
|
||||
|
@ -61,20 +61,22 @@ class WC_Admin_Notes_Draw_Attention {
|
|||
|
||||
/**
|
||||
* Get the note.
|
||||
*
|
||||
* @return Note
|
||||
*/
|
||||
public static function get_note() {
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
$note->set_title( __( 'How to draw attention to your online store', 'woocommerce-admin' ) );
|
||||
$note->set_content( __( 'To get you started, here are seven ways to boost your sales and avoid getting drowned out by similar, mass-produced products competing for the same buyers.', 'woocommerce-admin' ) );
|
||||
$note->set_content_data( (object) array() );
|
||||
$note->set_type( WC_ADMIN_Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$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://woocommerce.com/posts/how-to-make-your-online-store-stand-out/?utm_source=inbox',
|
||||
WC_Admin_Note::E_WC_ADMIN_NOTE_ACTIONED,
|
||||
Note::E_WC_ADMIN_NOTE_ACTIONED,
|
||||
true
|
||||
);
|
||||
return $note;
|
|
@ -10,9 +10,9 @@ namespace Automattic\WooCommerce\Admin\Notes;
|
|||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_EU_VAT_Number
|
||||
* EU_VAT_Number
|
||||
*/
|
||||
class WC_Admin_Notes_EU_VAT_Number {
|
||||
class EU_VAT_Number {
|
||||
/**
|
||||
* Note traits.
|
||||
*/
|
||||
|
@ -25,6 +25,8 @@ class WC_Admin_Notes_EU_VAT_Number {
|
|||
|
||||
/**
|
||||
* Get the note.
|
||||
*
|
||||
* @return Note
|
||||
*/
|
||||
public static function get_note() {
|
||||
if ( 'yes' !== get_option( 'wc_connect_taxes_enabled', 'no' ) ) {
|
||||
|
@ -39,18 +41,18 @@ class WC_Admin_Notes_EU_VAT_Number {
|
|||
|
||||
$content = __( "If your store is based in the EU, we recommend using the EU VAT Number extension in addition to automated taxes. It provides your checkout with a field to collect and validate a customer's EU VAT number, if they have one.", 'woocommerce-admin' );
|
||||
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
$note->set_title( __( 'Collect and validate EU VAT numbers at checkout', 'woocommerce-admin' ) );
|
||||
$note->set_content( $content );
|
||||
$note->set_content_data( (object) array() );
|
||||
$note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_MARKETING );
|
||||
$note->set_type( Note::E_WC_ADMIN_NOTE_MARKETING );
|
||||
$note->set_name( self::NOTE_NAME );
|
||||
$note->set_source( 'woocommerce-admin' );
|
||||
$note->add_action(
|
||||
'learn-more',
|
||||
__( 'Learn more', 'woocommerce-admin' ),
|
||||
'https://woocommerce.com/products/eu-vat-number/',
|
||||
'actioned',
|
||||
Note::E_WC_ADMIN_NOTE_ACTIONED,
|
||||
true
|
||||
);
|
||||
return $note;
|
|
@ -10,9 +10,9 @@ namespace Automattic\WooCommerce\Admin\Notes;
|
|||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Edit_Products_On_The_Move
|
||||
* Edit_Products_On_The_Move
|
||||
*/
|
||||
class WC_Admin_Notes_Edit_Products_On_The_Move {
|
||||
class Edit_Products_On_The_Move {
|
||||
/**
|
||||
* Note traits.
|
||||
*/
|
||||
|
@ -25,6 +25,8 @@ class WC_Admin_Notes_Edit_Products_On_The_Move {
|
|||
|
||||
/**
|
||||
* Get the note.
|
||||
*
|
||||
* @return Note
|
||||
*/
|
||||
public static function get_note() {
|
||||
// Only add this note if this store is at least a year old.
|
||||
|
@ -34,24 +36,24 @@ class WC_Admin_Notes_Edit_Products_On_The_Move {
|
|||
}
|
||||
|
||||
// Check that the previous mobile app notes have not been actioned.
|
||||
if ( WC_Admin_Notes_Mobile_App::has_note_been_actioned() ) {
|
||||
if ( Mobile_App::has_note_been_actioned() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( WC_Admin_Notes_Real_Time_Order_Alerts::has_note_been_actioned() ) {
|
||||
if ( Real_Time_Order_Alerts::has_note_been_actioned() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( WC_Admin_Notes_Performance_On_Mobile::has_note_been_actioned() ) {
|
||||
if ( Performance_On_Mobile::has_note_been_actioned() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
|
||||
$note->set_title( __( 'Edit products on the move', 'woocommerce-admin' ) );
|
||||
$note->set_content( __( 'Edit and create new products from your mobile devices with the Woo app', 'woocommerce-admin' ) );
|
||||
$note->set_content_data( (object) array() );
|
||||
$note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_name( self::NOTE_NAME );
|
||||
$note->set_source( 'woocommerce-admin' );
|
||||
$note->add_action(
|
|
@ -10,9 +10,9 @@ namespace Automattic\WooCommerce\Admin\Notes;
|
|||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_First_Product.
|
||||
* First_Product.
|
||||
*/
|
||||
class WC_Admin_Notes_First_Product {
|
||||
class First_Product {
|
||||
/**
|
||||
* Note traits.
|
||||
*/
|
||||
|
@ -25,6 +25,8 @@ class WC_Admin_Notes_First_Product {
|
|||
|
||||
/**
|
||||
* Get the note.
|
||||
*
|
||||
* @return Note
|
||||
*/
|
||||
public static function get_note() {
|
||||
// We want to show the note after seven days.
|
||||
|
@ -63,10 +65,10 @@ class WC_Admin_Notes_First_Product {
|
|||
return;
|
||||
}
|
||||
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
$note->set_title( __( 'Do you need help with adding your first product?', 'woocommerce-admin' ) );
|
||||
$note->set_content( __( 'This video tutorial will help you go through the process of adding your first product in WooCommerce.', 'woocommerce-admin' ) );
|
||||
$note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_name( self::NOTE_NAME );
|
||||
$note->set_content_data( (object) array() );
|
||||
$note->set_source( 'woocommerce-admin' );
|
|
@ -10,9 +10,9 @@ namespace Automattic\WooCommerce\Admin\Notes;
|
|||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Giving_Feedback_Notes
|
||||
* Giving_Feedback_Notes
|
||||
*/
|
||||
class WC_Admin_Notes_Giving_Feedback_Notes {
|
||||
class Giving_Feedback_Notes {
|
||||
/**
|
||||
* Note traits.
|
||||
*/
|
||||
|
@ -25,6 +25,8 @@ class WC_Admin_Notes_Giving_Feedback_Notes {
|
|||
|
||||
/**
|
||||
* Get the note.
|
||||
*
|
||||
* @return Note
|
||||
*/
|
||||
protected static function get_note() {
|
||||
// We need to show Admin Giving feeback notification after 8 days of install.
|
||||
|
@ -34,11 +36,11 @@ class WC_Admin_Notes_Giving_Feedback_Notes {
|
|||
}
|
||||
|
||||
// Otherwise, create our new note.
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
$note->set_title( __( 'Give feedback', 'woocommerce-admin' ) );
|
||||
$note->set_content( __( 'Now that you’ve chosen us as a partner, our goal is to make sure we\'re providing the right tools to meet your needs. We\'re looking forward to having your feedback on the store setup experience so we can improve it in the future.', 'woocommerce-admin' ) );
|
||||
$note->set_content_data( (object) array() );
|
||||
$note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_name( self::NOTE_NAME );
|
||||
$note->set_source( 'woocommerce-admin' );
|
||||
$note->add_action(
|
|
@ -16,8 +16,7 @@ use \Automattic\WooCommerce\Admin\PluginsHelper;
|
|||
/**
|
||||
* WC_Admin_Notes_Google_Ads_And_Marketing
|
||||
*/
|
||||
class WC_Admin_Notes_Google_Ads_And_Marketing {
|
||||
|
||||
class Google_Ads_And_Marketing {
|
||||
/**
|
||||
* Note traits.
|
||||
*/
|
||||
|
@ -59,12 +58,14 @@ class WC_Admin_Notes_Google_Ads_And_Marketing {
|
|||
|
||||
/**
|
||||
* Get the note.
|
||||
*
|
||||
* @return Note
|
||||
*/
|
||||
public static function get_note() {
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
$note->set_title( __( 'Get your products in front of millions of shoppers on Google to grow your sales', 'woocommerce-admin' ) );
|
||||
$note->set_content( __( 'Google Ads & Marketing makes it easy to promote products on any budget. Run paid Smart Shopping campaigns to get your top selling products in front of buyers across the Google Network. You can also drive free traffic to your store with free listings for only $10 per month!', 'woocommerce-admin' ) );
|
||||
$note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_name( self::NOTE_NAME );
|
||||
$note->set_content_data( (object) array() );
|
||||
$note->set_source( 'woocommerce-admin' );
|
||||
|
@ -72,7 +73,7 @@ class WC_Admin_Notes_Google_Ads_And_Marketing {
|
|||
'get-started',
|
||||
__( 'Get started', 'woocommerce-admin' ),
|
||||
'https://woocommerce.com/products/google-ads-and-marketing/',
|
||||
WC_Admin_Note::E_WC_ADMIN_NOTE_ACTIONED,
|
||||
Note::E_WC_ADMIN_NOTE_ACTIONED,
|
||||
true
|
||||
);
|
||||
return $note;
|
|
@ -12,9 +12,9 @@ defined( 'ABSPATH' ) || exit;
|
|||
use \Automattic\WooCommerce\Admin\Install;
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Historical_Data.
|
||||
* Historical_Data.
|
||||
*/
|
||||
class WC_Admin_Notes_Historical_Data {
|
||||
class Historical_Data {
|
||||
/**
|
||||
* Note traits.
|
||||
*/
|
||||
|
@ -42,7 +42,7 @@ class WC_Admin_Notes_Historical_Data {
|
|||
return;
|
||||
}
|
||||
|
||||
$note = WC_Admin_Notes::get_note( $note_ids[0] );
|
||||
$note = Notes::get_note( $note_ids[0] );
|
||||
if ( false === $note ) {
|
||||
return;
|
||||
}
|
||||
|
@ -53,6 +53,8 @@ class WC_Admin_Notes_Historical_Data {
|
|||
|
||||
/**
|
||||
* Get the note.
|
||||
*
|
||||
* @return Note
|
||||
*/
|
||||
public static function get_note() {
|
||||
$is_upgrading = get_option( Install::VERSION_OPTION );
|
||||
|
@ -70,10 +72,10 @@ class WC_Admin_Notes_Historical_Data {
|
|||
return;
|
||||
}
|
||||
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
$note->set_title( __( 'WooCommerce Admin: Historical Analytics Data', 'woocommerce-admin' ) );
|
||||
$note->set_content( __( 'To view your historical analytics data, you must process your existing orders and customers.', 'woocommerce-admin' ) );
|
||||
$note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_UPDATE );
|
||||
$note->set_type( Note::E_WC_ADMIN_NOTE_UPDATE );
|
||||
$note->set_name( self::NOTE_NAME );
|
||||
$note->set_content_data( (object) array() );
|
||||
$note->set_source( 'woocommerce-admin' );
|
|
@ -10,9 +10,9 @@ namespace Automattic\WooCommerce\Admin\Notes;
|
|||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Home_Screen_Feedback.
|
||||
* Home_Screen_Feedback.
|
||||
*/
|
||||
class WC_Admin_Notes_Home_Screen_Feedback {
|
||||
class Home_Screen_Feedback {
|
||||
/**
|
||||
* Note traits.
|
||||
*/
|
||||
|
@ -49,6 +49,8 @@ class WC_Admin_Notes_Home_Screen_Feedback {
|
|||
|
||||
/**
|
||||
* Get the note.
|
||||
*
|
||||
* @return Note
|
||||
*/
|
||||
public static function get_note() {
|
||||
// Homescreen first accessed at least 12 days ago.
|
||||
|
@ -62,10 +64,10 @@ class WC_Admin_Notes_Home_Screen_Feedback {
|
|||
return;
|
||||
}
|
||||
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
$note->set_title( __( 'Help us improve the WooCommerce Home screen', 'woocommerce-admin' ) );
|
||||
$note->set_content( __( 'We\'d love your input to shape the future of the WooCommerce Home screen together. Feel free to share any feedback, ideas or suggestions that you have.', 'woocommerce-admin' ) );
|
||||
$note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_name( self::NOTE_NAME );
|
||||
$note->set_content_data( (object) array() );
|
||||
$note->set_source( 'woocommerce-admin' );
|
|
@ -12,9 +12,9 @@ namespace Automattic\WooCommerce\Admin\Notes;
|
|||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Insight_First_Sale.
|
||||
* Insight_First_Sale.
|
||||
*/
|
||||
class WC_Admin_Notes_Insight_First_Sale {
|
||||
class Insight_First_Sale {
|
||||
/**
|
||||
* Note traits.
|
||||
*/
|
||||
|
@ -27,6 +27,8 @@ class WC_Admin_Notes_Insight_First_Sale {
|
|||
|
||||
/**
|
||||
* Get the note.
|
||||
*
|
||||
* @return Note
|
||||
*/
|
||||
public static function get_note() {
|
||||
// We want to show the note after eight days.
|
||||
|
@ -34,10 +36,10 @@ class WC_Admin_Notes_Insight_First_Sale {
|
|||
return;
|
||||
}
|
||||
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
$note->set_title( __( 'Did you know?', 'woocommerce-admin' ) );
|
||||
$note->set_content( __( 'A WooCommerce powered store needs on average 31 days to get the first sale. You\'re on the right track! Do you find this type of insight useful?', 'woocommerce-admin' ) );
|
||||
$note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_SURVEY );
|
||||
$note->set_type( Note::E_WC_ADMIN_NOTE_SURVEY );
|
||||
$note->set_name( self::NOTE_NAME );
|
||||
$note->set_content_data( (object) array() );
|
||||
$note->set_source( 'woocommerce-admin' );
|
||||
|
@ -49,7 +51,7 @@ class WC_Admin_Notes_Insight_First_Sale {
|
|||
'affirm-insight-first-sale',
|
||||
__( 'Yes', 'woocommerce-admin' ),
|
||||
false,
|
||||
WC_Admin_Note::E_WC_ADMIN_NOTE_ACTIONED,
|
||||
Note::E_WC_ADMIN_NOTE_ACTIONED,
|
||||
false,
|
||||
__( 'Thanks for your feedback', 'woocommerce-admin' )
|
||||
);
|
||||
|
@ -57,7 +59,7 @@ class WC_Admin_Notes_Insight_First_Sale {
|
|||
'deny-insight-first-sale',
|
||||
__( 'No', 'woocommerce-admin' ),
|
||||
false,
|
||||
WC_Admin_Note::E_WC_ADMIN_NOTE_ACTIONED,
|
||||
Note::E_WC_ADMIN_NOTE_ACTIONED,
|
||||
false,
|
||||
__( 'Thanks for your feedback', 'woocommerce-admin' )
|
||||
);
|
|
@ -14,9 +14,9 @@ defined( 'ABSPATH' ) || exit;
|
|||
use \Automattic\WooCommerce\Admin\PluginsHelper;
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Install_JP_And_WCS_Plugins
|
||||
* Install_JP_And_WCS_Plugins
|
||||
*/
|
||||
class WC_Admin_Notes_Install_JP_And_WCS_Plugins {
|
||||
class Install_JP_And_WCS_Plugins {
|
||||
/**
|
||||
* Note traits.
|
||||
*/
|
||||
|
@ -37,22 +37,24 @@ class WC_Admin_Notes_Install_JP_And_WCS_Plugins {
|
|||
|
||||
/**
|
||||
* Get the note.
|
||||
*
|
||||
* @return Note
|
||||
*/
|
||||
public static function get_note() {
|
||||
$content = __( 'We noticed that there was a problem during the Jetpack and WooCommerce Shipping & Tax install. Please try again and enjoy all the advantages of having the plugins connected to your store! Sorry for the inconvenience. The "Jetpack" and "WooCommerce Shipping & Tax" plugins will be installed & activated for free.', 'woocommerce-admin' );
|
||||
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
$note->set_title( __( 'Uh oh... There was a problem during the Jetpack and WooCommerce Shipping & Tax install. Please try again.', 'woocommerce-admin' ) );
|
||||
$note->set_content( $content );
|
||||
$note->set_content_data( (object) array() );
|
||||
$note->set_type( WC_ADMIN_Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_name( self::NOTE_NAME );
|
||||
$note->set_source( 'woocommerce-admin' );
|
||||
$note->add_action(
|
||||
'install-jp-and-wcs-plugins',
|
||||
__( 'Install plugins', 'woocommerce-admin' ),
|
||||
false,
|
||||
WC_Admin_Note::E_WC_ADMIN_NOTE_ACTIONED,
|
||||
Note::E_WC_ADMIN_NOTE_ACTIONED,
|
||||
true
|
||||
);
|
||||
return $note;
|
||||
|
@ -78,10 +80,10 @@ class WC_Admin_Notes_Install_JP_And_WCS_Plugins {
|
|||
$note_ids = $data_store->get_notes_with_name( self::NOTE_NAME );
|
||||
|
||||
foreach ( $note_ids as $note_id ) {
|
||||
$note = WC_Admin_Notes::get_note( $note_id );
|
||||
$note = Notes::get_note( $note_id );
|
||||
|
||||
if ( $note ) {
|
||||
$note->set_status( WC_Admin_Note::E_WC_ADMIN_NOTE_ACTIONED );
|
||||
$note->set_status( Note::E_WC_ADMIN_NOTE_ACTIONED );
|
||||
$note->save();
|
||||
}
|
||||
}
|
||||
|
@ -91,7 +93,7 @@ class WC_Admin_Notes_Install_JP_And_WCS_Plugins {
|
|||
* Install the Jetpack and WooCommerce Shipping & Tax plugins in response to the action
|
||||
* being clicked in the admin note.
|
||||
*
|
||||
* @param WC_Admin_Note $note The note being actioned.
|
||||
* @param Note $note The note being actioned.
|
||||
*/
|
||||
public function install_jp_and_wcs_plugins( $note ) {
|
||||
if ( self::NOTE_NAME !== $note->get_name() ) {
|
|
@ -10,9 +10,9 @@ namespace Automattic\WooCommerce\Admin\Notes;
|
|||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Launch_Checklist
|
||||
* Launch_Checklist
|
||||
*/
|
||||
class WC_Admin_Notes_Launch_Checklist {
|
||||
class Launch_Checklist {
|
||||
/**
|
||||
* Note traits.
|
||||
*/
|
||||
|
@ -25,6 +25,8 @@ class WC_Admin_Notes_Launch_Checklist {
|
|||
|
||||
/**
|
||||
* Get the note.
|
||||
*
|
||||
* @return Note
|
||||
*/
|
||||
public static function get_note() {
|
||||
// Only add this note if completing the task list or completed 3 tasks in 10 days.
|
||||
|
@ -42,11 +44,11 @@ class WC_Admin_Notes_Launch_Checklist {
|
|||
|
||||
$content = __( 'To make sure you never get that sinking "what did I forget" feeling, we\'ve put together the essential pre-launch checklist.', 'woocommerce-admin' );
|
||||
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
$note->set_title( __( 'Ready to launch your store?', 'woocommerce-admin' ) );
|
||||
$note->set_content( $content );
|
||||
$note->set_content_data( (object) array() );
|
||||
$note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$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://woocommerce.com/posts/pre-launch-checklist-the-essentials/?utm_source=inbox' );
|
|
@ -12,9 +12,9 @@ defined( 'ABSPATH' ) || exit;
|
|||
use \Automattic\WooCommerce\Admin\Features\Onboarding;
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Learn_More_About_Product_Settings.
|
||||
* Learn_More_About_Product_Settings.
|
||||
*/
|
||||
class WC_Admin_Notes_Learn_More_About_Product_Settings {
|
||||
class Learn_More_About_Product_Settings {
|
||||
/**
|
||||
* Note traits.
|
||||
*/
|
||||
|
@ -27,6 +27,8 @@ class WC_Admin_Notes_Learn_More_About_Product_Settings {
|
|||
|
||||
/**
|
||||
* Get the note.
|
||||
*
|
||||
* @return Note
|
||||
*/
|
||||
public static function get_note() {
|
||||
$onboarding_profile = get_option( 'woocommerce_onboarding_profile', array() );
|
||||
|
@ -63,10 +65,10 @@ class WC_Admin_Notes_Learn_More_About_Product_Settings {
|
|||
return;
|
||||
}
|
||||
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
$note->set_title( __( 'Learn more about Product Settings', 'woocommerce-admin' ) );
|
||||
$note->set_content( __( 'In this video you\'ll find information about configuring product settings, such as how they are displayed, editing inventory options and so on.', 'woocommerce-admin' ) );
|
||||
$note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_name( self::NOTE_NAME );
|
||||
$note->set_content_data( (object) array() );
|
||||
$note->set_source( 'woocommerce-admin' );
|
||||
|
@ -74,7 +76,7 @@ class WC_Admin_Notes_Learn_More_About_Product_Settings {
|
|||
'learn-more-about-product-settings',
|
||||
__( 'Watch tutorial', 'woocommerce-admin' ),
|
||||
'https://www.youtube.com/watch?v=FEmwJsE8xDY&t=',
|
||||
WC_Admin_Note::E_WC_ADMIN_NOTE_ACTIONED,
|
||||
Note::E_WC_ADMIN_NOTE_ACTIONED,
|
||||
true
|
||||
);
|
||||
return $note;
|
|
@ -10,9 +10,9 @@ namespace Automattic\WooCommerce\Admin\Notes;
|
|||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Marketing
|
||||
* Marketing
|
||||
*/
|
||||
class WC_Admin_Notes_Marketing {
|
||||
class Marketing {
|
||||
|
||||
/**
|
||||
* Note traits.
|
||||
|
@ -26,12 +26,14 @@ class WC_Admin_Notes_Marketing {
|
|||
|
||||
/**
|
||||
* Get the note.
|
||||
*
|
||||
* @return Note
|
||||
*/
|
||||
public static function get_note() {
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
$note->set_title( __( 'Connect with your audience', 'woocommerce-admin' ) );
|
||||
$note->set_content( __( 'Grow your customer base and increase your sales with marketing tools built for WooCommerce.', 'woocommerce-admin' ) );
|
||||
$note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_name( self::NOTE_NAME );
|
||||
$note->set_content_data( (object) array() );
|
||||
$note->set_source( 'woocommerce-admin' );
|
||||
|
@ -39,7 +41,7 @@ class WC_Admin_Notes_Marketing {
|
|||
'open-marketing-hub',
|
||||
__( 'Open marketing hub', 'woocommerce-admin' ),
|
||||
admin_url( 'admin.php?page=wc-admin&path=/marketing' ),
|
||||
WC_Admin_Note::E_WC_ADMIN_NOTE_ACTIONED
|
||||
Note::E_WC_ADMIN_NOTE_ACTIONED
|
||||
);
|
||||
return $note;
|
||||
}
|
|
@ -10,9 +10,9 @@ namespace Automattic\WooCommerce\Admin\Notes;
|
|||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Migrate_From_Shopify.
|
||||
* Migrate_From_Shopify.
|
||||
*/
|
||||
class WC_Admin_Notes_Migrate_From_Shopify {
|
||||
class Migrate_From_Shopify {
|
||||
/**
|
||||
* Note traits.
|
||||
*/
|
||||
|
@ -25,6 +25,8 @@ class WC_Admin_Notes_Migrate_From_Shopify {
|
|||
|
||||
/**
|
||||
* Get the note.
|
||||
*
|
||||
* @return Note
|
||||
*/
|
||||
public static function get_note() {
|
||||
|
||||
|
@ -56,10 +58,10 @@ class WC_Admin_Notes_Migrate_From_Shopify {
|
|||
return;
|
||||
}
|
||||
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
$note->set_title( __( 'Do you want to migrate from Shopify to WooCommerce?', 'woocommerce-admin' ) );
|
||||
$note->set_content( __( 'Changing eCommerce platforms might seem like a big hurdle to overcome, but it is easier than you might think to move your products, customers, and orders to WooCommerce. This article will help you with going through this process.', 'woocommerce-admin' ) );
|
||||
$note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_name( self::NOTE_NAME );
|
||||
$note->set_content_data( (object) array() );
|
||||
$note->set_source( 'woocommerce-admin' );
|
||||
|
@ -67,7 +69,7 @@ class WC_Admin_Notes_Migrate_From_Shopify {
|
|||
'migrate-from-shopify',
|
||||
__( 'Learn more', 'woocommerce-admin' ),
|
||||
'https://woocommerce.com/posts/migrate-from-shopify-to-woocommerce/?utm_source=inbox',
|
||||
WC_Admin_Note::E_WC_ADMIN_NOTE_ACTIONED,
|
||||
Note::E_WC_ADMIN_NOTE_ACTIONED,
|
||||
true
|
||||
);
|
||||
return $note;
|
|
@ -10,9 +10,9 @@ namespace Automattic\WooCommerce\Admin\Notes;
|
|||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Mobile_App
|
||||
* Mobile_App
|
||||
*/
|
||||
class WC_Admin_Notes_Mobile_App {
|
||||
class Mobile_App {
|
||||
/**
|
||||
* Note traits.
|
||||
*/
|
||||
|
@ -25,6 +25,8 @@ class WC_Admin_Notes_Mobile_App {
|
|||
|
||||
/**
|
||||
* Get the note.
|
||||
*
|
||||
* @return Note
|
||||
*/
|
||||
public static function get_note() {
|
||||
// We want to show the mobile app note after day 2.
|
||||
|
@ -35,11 +37,11 @@ class WC_Admin_Notes_Mobile_App {
|
|||
|
||||
$content = __( 'Install the WooCommerce mobile app to manage orders, receive sales notifications, and view key metrics — wherever you are.', 'woocommerce-admin' );
|
||||
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
$note->set_title( __( 'Install Woo mobile app', 'woocommerce-admin' ) );
|
||||
$note->set_content( $content );
|
||||
$note->set_content_data( (object) array() );
|
||||
$note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$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://woocommerce.com/mobile/' );
|
|
@ -10,9 +10,9 @@ namespace Automattic\WooCommerce\Admin\Notes;
|
|||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Need_Some_Inspiration.
|
||||
* Need_Some_Inspiration.
|
||||
*/
|
||||
class WC_Admin_Notes_Need_Some_Inspiration {
|
||||
class Need_Some_Inspiration {
|
||||
/**
|
||||
* Note traits.
|
||||
*/
|
||||
|
@ -25,6 +25,8 @@ class WC_Admin_Notes_Need_Some_Inspiration {
|
|||
|
||||
/**
|
||||
* Get the note.
|
||||
*
|
||||
* @return Note
|
||||
*/
|
||||
public static function get_note() {
|
||||
// We want to show the note after five days.
|
||||
|
@ -53,10 +55,10 @@ class WC_Admin_Notes_Need_Some_Inspiration {
|
|||
return;
|
||||
}
|
||||
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
$note->set_title( __( 'Do you need some inspiration?', 'woocommerce-admin' ) );
|
||||
$note->set_content( __( 'Check some of our favorite customer stories from entrepreneurs, agencies, and developers in our global community.', 'woocommerce-admin' ) );
|
||||
$note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_name( self::NOTE_NAME );
|
||||
$note->set_content_data( (object) array() );
|
||||
$note->set_source( 'woocommerce-admin' );
|
||||
|
@ -64,7 +66,7 @@ class WC_Admin_Notes_Need_Some_Inspiration {
|
|||
'need-some-inspiration',
|
||||
__( 'See success stories', 'woocommerce-admin' ),
|
||||
'https://woocommerce.com/success-stories/?utm_source=inbox',
|
||||
WC_Admin_Note::E_WC_ADMIN_NOTE_ACTIONED,
|
||||
Note::E_WC_ADMIN_NOTE_ACTIONED,
|
||||
true
|
||||
);
|
||||
return $note;
|
|
@ -10,9 +10,9 @@ namespace Automattic\WooCommerce\Admin\Notes;
|
|||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_New_Sales_Record
|
||||
* New_Sales_Record
|
||||
*/
|
||||
class WC_Admin_Notes_New_Sales_Record {
|
||||
class New_Sales_Record {
|
||||
/**
|
||||
* Note traits.
|
||||
*/
|
||||
|
@ -113,16 +113,16 @@ class WC_Admin_Notes_New_Sales_Record {
|
|||
);
|
||||
|
||||
// We only want one sales record note at any time in the inbox, so we delete any other first.
|
||||
WC_Admin_Notes::delete_notes_with_name( self::NOTE_NAME );
|
||||
Notes::delete_notes_with_name( self::NOTE_NAME );
|
||||
|
||||
$report_url = '?page=wc-admin&path=/analytics/revenue&period=custom&compare=previous_year&after=' . $yesterday . '&before=' . $yesterday;
|
||||
|
||||
// And now, create our new note.
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
$note->set_title( __( 'New sales record!', 'woocommerce-admin' ) );
|
||||
$note->set_content( $content );
|
||||
$note->set_content_data( $content_data );
|
||||
$note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_name( self::NOTE_NAME );
|
||||
$note->set_source( 'woocommerce-admin' );
|
||||
$note->add_action( 'view-report', __( 'View report', 'woocommerce-admin' ), $report_url );
|
|
@ -10,9 +10,9 @@ namespace Automattic\WooCommerce\Admin\Notes;
|
|||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* WC_Admin_Note class.
|
||||
* Note class.
|
||||
*/
|
||||
class WC_Admin_Note extends \WC_Data {
|
||||
class Note extends \WC_Data {
|
||||
|
||||
// Note types.
|
||||
const E_WC_ADMIN_NOTE_ERROR = 'error'; // used for presenting error conditions.
|
||||
|
@ -69,7 +69,7 @@ class WC_Admin_Note extends \WC_Data {
|
|||
|
||||
parent::__construct( $data );
|
||||
|
||||
if ( $data instanceof WC_Admin_Note ) {
|
||||
if ( $data instanceof Note ) {
|
||||
$this->set_id( absint( $data->get_id() ) );
|
||||
} elseif ( is_numeric( $data ) ) {
|
||||
$this->set_id( $data );
|
|
@ -49,7 +49,7 @@ trait NoteTraits {
|
|||
public static function can_be_added() {
|
||||
$note = self::get_note();
|
||||
|
||||
if ( ! $note instanceof WC_Admin_Note ) {
|
||||
if ( ! $note instanceof Note && ! $note instanceof WC_Admin_Note ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -59,7 +59,7 @@ trait NoteTraits {
|
|||
|
||||
if (
|
||||
'no' === get_option( 'woocommerce_show_marketplace_suggestions', 'yes' ) &&
|
||||
WC_Admin_Note::E_WC_ADMIN_NOTE_MARKETING === $note->get_type()
|
||||
Note::E_WC_ADMIN_NOTE_MARKETING === $note->get_type()
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ trait NoteTraits {
|
|||
$note_ids = $data_store->get_notes_with_name( self::NOTE_NAME );
|
||||
|
||||
foreach ( $note_ids as $note_id ) {
|
||||
$note = WC_Admin_Notes::get_note( $note_id );
|
||||
$note = Notes::get_note( $note_id );
|
||||
|
||||
if ( $note ) {
|
||||
$data_store->delete( $note );
|
||||
|
@ -115,9 +115,9 @@ trait NoteTraits {
|
|||
$note_ids = $data_store->get_notes_with_name( self::NOTE_NAME );
|
||||
|
||||
if ( ! empty( $note_ids ) ) {
|
||||
$note = WC_Admin_Notes::get_note( $note_ids[0] );
|
||||
$note = Notes::get_note( $note_ids[0] );
|
||||
|
||||
if ( WC_Admin_Note::E_WC_ADMIN_NOTE_ACTIONED === $note->get_status() ) {
|
||||
if ( Note::E_WC_ADMIN_NOTE_ACTIONED === $note->get_status() ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
/**
|
||||
* Admin Notes class.
|
||||
*/
|
||||
class WC_Admin_Notes {
|
||||
class Notes {
|
||||
/**
|
||||
* Hook used for recurring "unsnooze" action.
|
||||
*/
|
||||
|
@ -39,7 +39,7 @@ class WC_Admin_Notes {
|
|||
$notes = array();
|
||||
foreach ( (array) $raw_notes as $raw_note ) {
|
||||
try {
|
||||
$note = new WC_Admin_Note( $raw_note );
|
||||
$note = new Note( $raw_note );
|
||||
$note_id = $note->get_id();
|
||||
$notes[ $note_id ] = $note->get_data();
|
||||
$notes[ $note_id ]['name'] = $note->get_name( $context );
|
||||
|
@ -67,12 +67,12 @@ class WC_Admin_Notes {
|
|||
* Get admin note using it's ID
|
||||
*
|
||||
* @param int $note_id Note ID.
|
||||
* @return WC_Admin_Note|bool
|
||||
* @return Note|bool
|
||||
*/
|
||||
public static function get_note( $note_id ) {
|
||||
if ( false !== $note_id ) {
|
||||
try {
|
||||
return new WC_Admin_Note( $note_id );
|
||||
return new Note( $note_id );
|
||||
} catch ( \Exception $e ) {
|
||||
wc_caught_exception( $e, __CLASS__ . '::' . __FUNCTION__, array( $note_id ) );
|
||||
return false;
|
||||
|
@ -122,8 +122,8 @@ class WC_Admin_Notes {
|
|||
/**
|
||||
* Update a note.
|
||||
*
|
||||
* @param WC_Admin_Note $note The note that will be updated.
|
||||
* @param array $requested_updates a list of requested updates.
|
||||
* @param Note $note The note that will be updated.
|
||||
* @param array $requested_updates a list of requested updates.
|
||||
*/
|
||||
public static function update_note( $note, $requested_updates ) {
|
||||
$note_changed = false;
|
||||
|
@ -150,7 +150,7 @@ class WC_Admin_Notes {
|
|||
/**
|
||||
* Soft delete of a note.
|
||||
*
|
||||
* @param WC_Admin_Note $note The note that will be deleted.
|
||||
* @param Note $note The note that will be deleted.
|
||||
*/
|
||||
public static function delete_note( $note ) {
|
||||
$note->set_is_deleted( 1 );
|
||||
|
@ -172,10 +172,10 @@ class WC_Admin_Notes {
|
|||
'per_page' => 25,
|
||||
'page' => 1,
|
||||
'type' => array(
|
||||
WC_Admin_Note::E_WC_ADMIN_NOTE_INFORMATIONAL,
|
||||
WC_Admin_Note::E_WC_ADMIN_NOTE_MARKETING,
|
||||
WC_Admin_Note::E_WC_ADMIN_NOTE_WARNING,
|
||||
WC_Admin_Note::E_WC_ADMIN_NOTE_SURVEY,
|
||||
Note::E_WC_ADMIN_NOTE_INFORMATIONAL,
|
||||
Note::E_WC_ADMIN_NOTE_MARKETING,
|
||||
Note::E_WC_ADMIN_NOTE_WARNING,
|
||||
Note::E_WC_ADMIN_NOTE_SURVEY,
|
||||
),
|
||||
'is_deleted' => 0,
|
||||
)
|
||||
|
@ -199,7 +199,7 @@ class WC_Admin_Notes {
|
|||
$data_store = \WC_Data_Store::load( 'admin-note' );
|
||||
$raw_notes = $data_store->get_notes(
|
||||
array(
|
||||
'status' => array( WC_Admin_Note::E_WC_ADMIN_NOTE_SNOOZED ),
|
||||
'status' => array( Note::E_WC_ADMIN_NOTE_SNOOZED ),
|
||||
)
|
||||
);
|
||||
$now = new \DateTime();
|
||||
|
@ -213,7 +213,7 @@ class WC_Admin_Notes {
|
|||
$date_reminder = $note->get_date_reminder( 'edit' );
|
||||
|
||||
if ( $date_reminder < $now ) {
|
||||
$note->set_status( WC_Admin_Note::E_WC_ADMIN_NOTE_UNACTIONED );
|
||||
$note->set_status( Note::E_WC_ADMIN_NOTE_UNACTIONED );
|
||||
$note->set_date_reminder( null );
|
||||
$note->save();
|
||||
}
|
||||
|
@ -250,7 +250,7 @@ class WC_Admin_Notes {
|
|||
$data_store = \WC_Data_Store::load( 'admin-note' );
|
||||
$notes = $data_store->get_notes(
|
||||
array(
|
||||
'type' => array( WC_Admin_Note::E_WC_ADMIN_NOTE_MARKETING ),
|
||||
'type' => array( Note::E_WC_ADMIN_NOTE_MARKETING ),
|
||||
)
|
||||
);
|
||||
|
||||
|
@ -269,7 +269,7 @@ class WC_Admin_Notes {
|
|||
$data_store = \WC_Data_Store::load( 'admin-note' );
|
||||
$notes = $data_store->get_notes(
|
||||
array(
|
||||
'type' => array( WC_Admin_Note::E_WC_ADMIN_NOTE_SURVEY ),
|
||||
'type' => array( Note::E_WC_ADMIN_NOTE_SURVEY ),
|
||||
'status' => array( 'actioned' ),
|
||||
)
|
||||
);
|
|
@ -10,9 +10,9 @@ namespace Automattic\WooCommerce\Admin\Notes;
|
|||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Onboarding_Email_Marketing
|
||||
* Onboarding_Email_Marketing
|
||||
*/
|
||||
class WC_Admin_Notes_Onboarding_Email_Marketing {
|
||||
class Onboarding_Email_Marketing {
|
||||
/**
|
||||
* Note traits.
|
||||
*/
|
||||
|
@ -25,15 +25,17 @@ class WC_Admin_Notes_Onboarding_Email_Marketing {
|
|||
|
||||
/**
|
||||
* Get the note.
|
||||
*
|
||||
* @return Note
|
||||
*/
|
||||
public static function get_note() {
|
||||
$content = __( 'We\'re here for you - get tips, product updates and inspiration straight to your email box', 'woocommerce-admin' );
|
||||
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
$note->set_title( __( 'Tips, product updates, and inspiration', 'woocommerce-admin' ) );
|
||||
$note->set_content( $content );
|
||||
$note->set_content_data( (object) array() );
|
||||
$note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_name( self::NOTE_NAME );
|
||||
$note->set_source( 'woocommerce-admin' );
|
||||
$note->add_action( 'yes-please', __( 'Yes please!', 'woocommerce-admin' ), 'https://woocommerce.us8.list-manage.com/subscribe/post?u=2c1434dc56f9506bf3c3ecd21&id=13860df971&SIGNUPPAGE=plugin' );
|
|
@ -10,9 +10,9 @@ namespace Automattic\WooCommerce\Admin\Notes;
|
|||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Onboarding_Payments.
|
||||
* Onboarding_Payments.
|
||||
*/
|
||||
class WC_Admin_Notes_Onboarding_Payments {
|
||||
class Onboarding_Payments {
|
||||
/**
|
||||
* Note traits.
|
||||
*/
|
||||
|
@ -25,6 +25,8 @@ class WC_Admin_Notes_Onboarding_Payments {
|
|||
|
||||
/**
|
||||
* Get the note.
|
||||
*
|
||||
* @return Note
|
||||
*/
|
||||
public static function get_note() {
|
||||
// We want to show the note after five days.
|
||||
|
@ -44,10 +46,10 @@ class WC_Admin_Notes_Onboarding_Payments {
|
|||
return;
|
||||
}
|
||||
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
$note->set_title( __( 'Start accepting payments on your store!', 'woocommerce-admin' ) );
|
||||
$note->set_content( __( 'Take payments with the provider that’s right for you - choose from 100+ payment gateways for WooCommerce.', 'woocommerce-admin' ) );
|
||||
$note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_name( self::NOTE_NAME );
|
||||
$note->set_content_data( (object) array() );
|
||||
$note->set_source( 'woocommerce-admin' );
|
||||
|
@ -55,7 +57,7 @@ class WC_Admin_Notes_Onboarding_Payments {
|
|||
'view-payment-gateways',
|
||||
__( 'Learn more', 'woocommerce-admin' ),
|
||||
'https://woocommerce.com/product-category/woocommerce-extensions/payment-gateways/',
|
||||
'actioned',
|
||||
Note::E_WC_ADMIN_NOTE_ACTIONED,
|
||||
true
|
||||
);
|
||||
return $note;
|
|
@ -12,9 +12,9 @@ defined( 'ABSPATH' ) || exit;
|
|||
use \Automattic\WooCommerce\Admin\Features\Onboarding;
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Onboarding_Profiler.
|
||||
* Onboarding_Profiler.
|
||||
*/
|
||||
class WC_Admin_Notes_Onboarding_Profiler {
|
||||
class Onboarding_Profiler {
|
||||
/**
|
||||
* Note traits.
|
||||
*/
|
||||
|
@ -35,16 +35,18 @@ class WC_Admin_Notes_Onboarding_Profiler {
|
|||
|
||||
/**
|
||||
* Get the note.
|
||||
*
|
||||
* @return Note
|
||||
*/
|
||||
public static function get_note() {
|
||||
if ( ! Onboarding::should_show_profiler() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
$note->set_title( __( 'Welcome to WooCommerce! Set up your store and start selling', 'woocommerce-admin' ) );
|
||||
$note->set_content( __( "We're here to help you going through the most important steps to get your store up and running.", 'woocommerce-admin' ) );
|
||||
$note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_UPDATE );
|
||||
$note->set_type( Note::E_WC_ADMIN_NOTE_UPDATE );
|
||||
$note->set_name( self::NOTE_NAME );
|
||||
$note->set_content_data( (object) array() );
|
||||
$note->set_source( 'woocommerce-admin' );
|
||||
|
@ -52,7 +54,7 @@ class WC_Admin_Notes_Onboarding_Profiler {
|
|||
'continue-profiler',
|
||||
__( 'Continue Store Setup', 'woocommerce-admin' ),
|
||||
wc_admin_url( '&enable_onboarding=1' ),
|
||||
'unactioned',
|
||||
NOTE::E_WC_ADMIN_NOTE_UNACTIONED,
|
||||
true
|
||||
);
|
||||
$note->add_action(
|
||||
|
@ -86,7 +88,7 @@ class WC_Admin_Notes_Onboarding_Profiler {
|
|||
return;
|
||||
}
|
||||
|
||||
$note = WC_Admin_Notes::get_note( $note_ids[0] );
|
||||
$note = Notes::get_note( $note_ids[0] );
|
||||
|
||||
if ( false === $note ) {
|
||||
return;
|
|
@ -11,9 +11,9 @@ namespace Automattic\WooCommerce\Admin\Notes;
|
|||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Online_Clothing_Store.
|
||||
* Online_Clothing_Store.
|
||||
*/
|
||||
class WC_Admin_Notes_Online_Clothing_Store {
|
||||
class Online_Clothing_Store {
|
||||
/**
|
||||
* Note traits.
|
||||
*/
|
||||
|
@ -43,6 +43,8 @@ class WC_Admin_Notes_Online_Clothing_Store {
|
|||
|
||||
/**
|
||||
* Get the note.
|
||||
*
|
||||
* @return Note
|
||||
*/
|
||||
public static function get_note() {
|
||||
// We want to show the note after two days.
|
||||
|
@ -75,10 +77,10 @@ class WC_Admin_Notes_Online_Clothing_Store {
|
|||
return;
|
||||
}
|
||||
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
$note->set_title( __( 'Start your online clothing store', 'woocommerce-admin' ) );
|
||||
$note->set_content( __( 'Starting a fashion website is exciting but it may seem overwhelming as well. In this article, we\'ll walk you through the setup process, teach you to create successful product listings, and show you how to market to your ideal audience.', 'woocommerce-admin' ) );
|
||||
$note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_name( self::NOTE_NAME );
|
||||
$note->set_content_data( (object) array() );
|
||||
$note->set_source( 'woocommerce-admin' );
|
||||
|
@ -86,7 +88,7 @@ class WC_Admin_Notes_Online_Clothing_Store {
|
|||
'online-clothing-store',
|
||||
__( 'Learn more', 'woocommerce-admin' ),
|
||||
'https://woocommerce.com/posts/starting-an-online-clothing-store/?utm_source=inbox',
|
||||
WC_Admin_Note::E_WC_ADMIN_NOTE_ACTIONED,
|
||||
Note::E_WC_ADMIN_NOTE_ACTIONED,
|
||||
true
|
||||
);
|
||||
return $note;
|
|
@ -10,9 +10,9 @@ namespace Automattic\WooCommerce\Admin\Notes;
|
|||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Order_Milestones
|
||||
* Order_Milestones
|
||||
*/
|
||||
class WC_Admin_Notes_Order_Milestones {
|
||||
class Order_Milestones {
|
||||
/**
|
||||
* Name of the "other milestones" note.
|
||||
*/
|
||||
|
@ -304,15 +304,15 @@ class WC_Admin_Notes_Order_Milestones {
|
|||
$this->set_last_milestone( $current_milestone );
|
||||
|
||||
// We only want one milestone note at any time.
|
||||
WC_Admin_Notes::delete_notes_with_name( self::NOTE_NAME );
|
||||
Notes::delete_notes_with_name( self::NOTE_NAME );
|
||||
|
||||
// Add the milestone note.
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
$note->set_title( $this->get_note_title_for_milestone( $current_milestone ) );
|
||||
$note->set_content( $this->get_note_content_for_milestone( $current_milestone ) );
|
||||
$note_action = $this->get_note_action_for_milestone( $current_milestone );
|
||||
$note->add_action( $note_action['name'], $note_action['label'], $note_action['query'] );
|
||||
$note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_name( self::NOTE_NAME );
|
||||
$note->set_source( 'woocommerce-admin' );
|
||||
$note->save();
|
|
@ -10,9 +10,9 @@ namespace Automattic\WooCommerce\Admin\Notes;
|
|||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Performance_On_Mobile
|
||||
* Performance_On_Mobile
|
||||
*/
|
||||
class WC_Admin_Notes_Performance_On_Mobile {
|
||||
class Performance_On_Mobile {
|
||||
/**
|
||||
* Note traits.
|
||||
*/
|
||||
|
@ -25,6 +25,8 @@ class WC_Admin_Notes_Performance_On_Mobile {
|
|||
|
||||
/**
|
||||
* Get the note.
|
||||
*
|
||||
* @return Note
|
||||
*/
|
||||
public static function get_note() {
|
||||
// Only add this note if this store is at least 9 months old.
|
||||
|
@ -34,20 +36,20 @@ class WC_Admin_Notes_Performance_On_Mobile {
|
|||
}
|
||||
|
||||
// Check that the previous mobile app notes have not been actioned.
|
||||
if ( WC_Admin_Notes_Mobile_App::has_note_been_actioned() ) {
|
||||
if ( Mobile_App::has_note_been_actioned() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( WC_Admin_Notes_Real_Time_Order_Alerts::has_note_been_actioned() ) {
|
||||
if ( Real_Time_Order_Alerts::has_note_been_actioned() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
|
||||
$note->set_title( __( 'Track your store performance on mobile', 'woocommerce-admin' ) );
|
||||
$note->set_content( __( 'Monitor your sales and high performing products with the Woo app.', 'woocommerce-admin' ) );
|
||||
$note->set_content_data( (object) array() );
|
||||
$note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_name( self::NOTE_NAME );
|
||||
$note->set_source( 'woocommerce-admin' );
|
||||
$note->add_action(
|
|
@ -10,9 +10,9 @@ namespace Automattic\WooCommerce\Admin\Notes;
|
|||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Personalize_Store
|
||||
* Personalize_Store
|
||||
*/
|
||||
class WC_Admin_Notes_Personalize_Store {
|
||||
class Personalize_Store {
|
||||
/**
|
||||
* Note traits.
|
||||
*/
|
||||
|
@ -25,6 +25,8 @@ class WC_Admin_Notes_Personalize_Store {
|
|||
|
||||
/**
|
||||
* Get the note.
|
||||
*
|
||||
* @return Note
|
||||
*/
|
||||
public static function get_note() {
|
||||
// Only show the note to stores with homepage.
|
||||
|
@ -45,14 +47,14 @@ class WC_Admin_Notes_Personalize_Store {
|
|||
|
||||
$content = __( 'The homepage is one of the most important entry points in your store. When done right it can lead to higher conversions and engagement. Don\'t forget to personalize the homepage that we created for your store during the onboarding.', 'woocommerce-admin' );
|
||||
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
$note->set_title( __( 'Personalize your store\'s homepage', 'woocommerce-admin' ) );
|
||||
$note->set_content( $content );
|
||||
$note->set_content_data( (object) array() );
|
||||
$note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_name( self::NOTE_NAME );
|
||||
$note->set_source( 'woocommerce-admin' );
|
||||
$note->add_action( 'personalize-homepage', __( 'Personalize homepage', 'woocommerce-admin' ), admin_url( 'post.php?post=' . $homepage_id . '&action=edit' ), WC_Admin_Note::E_WC_ADMIN_NOTE_ACTIONED, true );
|
||||
$note->add_action( 'personalize-homepage', __( 'Personalize homepage', 'woocommerce-admin' ), admin_url( 'post.php?post=' . $homepage_id . '&action=edit' ), Note::E_WC_ADMIN_NOTE_ACTIONED, true );
|
||||
return $note;
|
||||
}
|
||||
}
|
|
@ -10,9 +10,9 @@ namespace Automattic\WooCommerce\Admin\Notes;
|
|||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Real_Time_Order_Alerts
|
||||
* Real_Time_Order_Alerts
|
||||
*/
|
||||
class WC_Admin_Notes_Real_Time_Order_Alerts {
|
||||
class Real_Time_Order_Alerts {
|
||||
/**
|
||||
* Note traits.
|
||||
*/
|
||||
|
@ -25,6 +25,8 @@ class WC_Admin_Notes_Real_Time_Order_Alerts {
|
|||
|
||||
/**
|
||||
* Get the note.
|
||||
*
|
||||
* @return Note
|
||||
*/
|
||||
public static function get_note() {
|
||||
// Only add this note if the store is 3 months old.
|
||||
|
@ -34,17 +36,17 @@ class WC_Admin_Notes_Real_Time_Order_Alerts {
|
|||
}
|
||||
|
||||
// Check that the previous mobile app note was not actioned.
|
||||
if ( WC_Admin_Notes_Mobile_App::has_note_been_actioned() ) {
|
||||
if ( Mobile_App::has_note_been_actioned() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$content = __( 'Get notifications about store activity, including new orders and product reviews directly on your mobile devices with the Woo app.', 'woocommerce-admin' );
|
||||
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
$note->set_title( __( 'Get real-time order alerts anywhere', 'woocommerce-admin' ) );
|
||||
$note->set_content( $content );
|
||||
$note->set_content_data( (object) array() );
|
||||
$note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$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://woocommerce.com/mobile/?utm_source=inbox' );
|
|
@ -12,9 +12,9 @@ namespace Automattic\WooCommerce\Admin\Notes;
|
|||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Review_Shipping_Settings
|
||||
* Review_Shipping_Settings
|
||||
*/
|
||||
class WC_Admin_Notes_Review_Shipping_Settings {
|
||||
class Review_Shipping_Settings {
|
||||
use NoteTraits;
|
||||
|
||||
const NOTE_NAME = 'wc-admin-review-shipping-settings';
|
||||
|
@ -22,10 +22,10 @@ class WC_Admin_Notes_Review_Shipping_Settings {
|
|||
/**
|
||||
* Get the note.
|
||||
*
|
||||
* @return WC_Admin_Note
|
||||
* @return Note
|
||||
*/
|
||||
public static function get_note() {
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
|
||||
$note->set_name( self::NOTE_NAME );
|
||||
$note->set_source( 'woocommerce-admin' );
|
||||
|
@ -40,13 +40,13 @@ class WC_Admin_Notes_Review_Shipping_Settings {
|
|||
)
|
||||
);
|
||||
$note->set_content_data( (object) array() );
|
||||
$note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
|
||||
$note->add_action(
|
||||
'edit-shipping-settings',
|
||||
__( 'Edit shipping settings', 'woocommerce-admin' ),
|
||||
admin_url( 'admin.php?page=wc-settings&tab=shipping' ),
|
||||
'unactioned',
|
||||
Note::E_WC_ADMIN_NOTE_UNACTIONED,
|
||||
true
|
||||
);
|
||||
|
|
@ -12,9 +12,9 @@ defined( 'ABSPATH' ) || exit;
|
|||
use \Automattic\WooCommerce\Admin\Features\Onboarding;
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Selling_Online_Courses
|
||||
* Selling_Online_Courses
|
||||
*/
|
||||
class WC_Admin_Notes_Selling_Online_Courses {
|
||||
class Selling_Online_Courses {
|
||||
/**
|
||||
* Note traits.
|
||||
*/
|
||||
|
@ -59,21 +59,23 @@ class WC_Admin_Notes_Selling_Online_Courses {
|
|||
|
||||
/**
|
||||
* Get the note.
|
||||
*
|
||||
* @return Note
|
||||
*/
|
||||
public static function get_note() {
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
|
||||
$note->set_title( __( 'Do you want to sell online courses?', 'woocommerce-admin' ) );
|
||||
$note->set_content( __( 'Online courses are a great solution for any business that can teach a new skill. Since courses don’t require physical product development or shipping, they’re affordable, fast to create, and can generate passive income for years to come. In this article, we provide you more information about selling courses using WooCommerce.', 'woocommerce-admin' ) );
|
||||
$note->set_content_data( (object) array() );
|
||||
$note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_MARKETING );
|
||||
$note->set_type( Note::E_WC_ADMIN_NOTE_MARKETING );
|
||||
$note->set_name( self::NOTE_NAME );
|
||||
$note->set_source( 'woocommerce-admin' );
|
||||
$note->add_action(
|
||||
'learn-more',
|
||||
__( 'Learn more', 'woocommerce-admin' ),
|
||||
'https://woocommerce.com/posts/how-to-sell-online-courses-wordpress/?utm_source=inbox',
|
||||
WC_Admin_Note::E_WC_ADMIN_NOTE_ACTIONED,
|
||||
Note::E_WC_ADMIN_NOTE_ACTIONED,
|
||||
true
|
||||
);
|
||||
|
|
@ -11,9 +11,9 @@ namespace Automattic\WooCommerce\Admin\Notes;
|
|||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Set_Up_Additional_Payment_Types
|
||||
* Set_Up_Additional_Payment_Types
|
||||
*/
|
||||
class WC_Admin_Notes_Set_Up_Additional_Payment_Types {
|
||||
class Set_Up_Additional_Payment_Types {
|
||||
/**
|
||||
* Note traits.
|
||||
*/
|
||||
|
@ -65,23 +65,25 @@ class WC_Admin_Notes_Set_Up_Additional_Payment_Types {
|
|||
|
||||
/**
|
||||
* Get the note.
|
||||
*
|
||||
* @return Note
|
||||
*/
|
||||
public static function get_note() {
|
||||
$content = __( 'Set up additional payment providers, using third-party services or other methods.', 'woocommerce-admin' );
|
||||
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
|
||||
$note->set_title( __( 'Set up additional payment providers', 'woocommerce-admin' ) );
|
||||
$note->set_content( $content );
|
||||
$note->set_content_data( (object) array() );
|
||||
$note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_name( self::NOTE_NAME );
|
||||
$note->set_source( 'woocommerce-admin' );
|
||||
$note->add_action(
|
||||
'set-up-payments',
|
||||
__( 'Set up payments', 'woocommerce-admin' ),
|
||||
wc_admin_url( '&task=payments' ),
|
||||
'unactioned',
|
||||
Note::E_WC_ADMIN_NOTE_UNACTIONED,
|
||||
true
|
||||
);
|
||||
|
|
@ -10,9 +10,9 @@ namespace Automattic\WooCommerce\Admin\Notes;
|
|||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Start_Dropshipping_Business.
|
||||
* Start_Dropshipping_Business.
|
||||
*/
|
||||
class WC_Admin_Notes_Start_Dropshipping_Business {
|
||||
class Start_Dropshipping_Business {
|
||||
/**
|
||||
* Note traits.
|
||||
*/
|
||||
|
@ -25,6 +25,8 @@ class WC_Admin_Notes_Start_Dropshipping_Business {
|
|||
|
||||
/**
|
||||
* Get the note.
|
||||
*
|
||||
* @return Note|null
|
||||
*/
|
||||
public static function get_note() {
|
||||
|
||||
|
@ -61,10 +63,10 @@ class WC_Admin_Notes_Start_Dropshipping_Business {
|
|||
return;
|
||||
}
|
||||
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
$note->set_title( __( 'Are you considering starting a dropshipping business?', 'woocommerce-admin' ) );
|
||||
$note->set_content( __( 'The ability to add inventory without having to deal with production, stocking, or fulfilling orders may seem like a dream. But is dropshipping worth it? Let’s explore some of the advantages and disadvantages to help you make the best decision for your business.', 'woocommerce-admin' ) );
|
||||
$note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_name( self::NOTE_NAME );
|
||||
$note->set_content_data( (object) array() );
|
||||
$note->set_source( 'woocommerce-admin' );
|
||||
|
@ -72,7 +74,7 @@ class WC_Admin_Notes_Start_Dropshipping_Business {
|
|||
'dropshipping-business',
|
||||
__( 'Learn more', 'woocommerce-admin' ),
|
||||
'https://woocommerce.com/posts/is-dropshipping-worth-it-pros-cons/?utm_source=inbox',
|
||||
WC_Admin_Note::E_WC_ADMIN_NOTE_ACTIONED,
|
||||
Note::E_WC_ADMIN_NOTE_ACTIONED,
|
||||
true
|
||||
);
|
||||
return $note;
|
|
@ -12,9 +12,9 @@ namespace Automattic\WooCommerce\Admin\Notes;
|
|||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Test_Checkout
|
||||
* Test_Checkout
|
||||
*/
|
||||
class WC_Admin_Notes_Test_Checkout {
|
||||
class Test_Checkout {
|
||||
/**
|
||||
* Note traits.
|
||||
*/
|
||||
|
@ -39,6 +39,8 @@ class WC_Admin_Notes_Test_Checkout {
|
|||
|
||||
/**
|
||||
* Get the note.
|
||||
*
|
||||
* @return Note|null
|
||||
*/
|
||||
public static function get_note() {
|
||||
$onboarding_profile = get_option( 'woocommerce_onboarding_profile', array() );
|
||||
|
@ -86,11 +88,11 @@ class WC_Admin_Notes_Test_Checkout {
|
|||
|
||||
$content = __( 'Make sure that your checkout is working properly before you launch your store. Go through your checkout process in its entirety: from adding a product to your cart, choosing a shipping location, and making a payment.', 'woocommerce-admin' );
|
||||
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
$note->set_title( __( 'Don\'t forget to test your checkout', 'woocommerce-admin' ) );
|
||||
$note->set_content( $content );
|
||||
$note->set_content_data( (object) array() );
|
||||
$note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_name( self::NOTE_NAME );
|
||||
$note->set_source( 'woocommerce-admin' );
|
||||
$note->add_action( 'test-checkout', __( 'Test checkout', 'woocommerce-admin' ), wc_get_page_permalink( 'shop' ) );
|
|
@ -10,9 +10,9 @@ namespace Automattic\WooCommerce\Admin\Notes;
|
|||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Tracking_Opt_In
|
||||
* Tracking_Opt_In
|
||||
*/
|
||||
class WC_Admin_Notes_Tracking_Opt_In {
|
||||
class Tracking_Opt_In {
|
||||
/**
|
||||
* Note traits.
|
||||
*/
|
||||
|
@ -32,6 +32,8 @@ class WC_Admin_Notes_Tracking_Opt_In {
|
|||
|
||||
/**
|
||||
* Get the note.
|
||||
*
|
||||
* @return Note|null
|
||||
*/
|
||||
public static function get_note() {
|
||||
// Only show this note to stores that are opted out.
|
||||
|
@ -57,21 +59,21 @@ class WC_Admin_Notes_Tracking_Opt_In {
|
|||
'</a>'
|
||||
);
|
||||
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
$note->set_title( __( 'Help WooCommerce improve with usage tracking', 'woocommerce-admin' ) );
|
||||
$note->set_content( $note_content );
|
||||
$note->set_content_data( (object) array() );
|
||||
$note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_name( self::NOTE_NAME );
|
||||
$note->set_source( 'woocommerce-admin' );
|
||||
$note->add_action( 'tracking-opt-in', __( 'Activate usage tracking', 'woocommerce-admin' ), false, WC_Admin_Note::E_WC_ADMIN_NOTE_ACTIONED, true );
|
||||
$note->add_action( 'tracking-opt-in', __( 'Activate usage tracking', 'woocommerce-admin' ), false, Note::E_WC_ADMIN_NOTE_ACTIONED, true );
|
||||
return $note;
|
||||
}
|
||||
|
||||
/**
|
||||
* Opt in to usage tracking when note is actioned.
|
||||
*
|
||||
* @param WC_Admin_Note $note Note being acted upon.
|
||||
* @param Note $note Note being acted upon.
|
||||
*/
|
||||
public function opt_in_to_tracking( $note ) {
|
||||
if ( self::NOTE_NAME === $note->get_name() ) {
|
|
@ -10,9 +10,9 @@ namespace Automattic\WooCommerce\Admin\Notes;
|
|||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_WooCommerce_Payments
|
||||
* WooCommerce_Payments
|
||||
*/
|
||||
class WC_Admin_Notes_WooCommerce_Payments {
|
||||
class WooCommerce_Payments {
|
||||
/**
|
||||
* Note traits.
|
||||
*/
|
||||
|
@ -56,14 +56,14 @@ class WC_Admin_Notes_WooCommerce_Payments {
|
|||
if ( ! empty( $note_ids ) ) {
|
||||
|
||||
$note_id = array_pop( $note_ids );
|
||||
$note = WC_Admin_Notes::get_note( $note_id );
|
||||
$note = Notes::get_note( $note_id );
|
||||
if ( false === $note ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// If the WooCommerce Payments plugin was installed after the note was created, make sure it's marked as actioned.
|
||||
if ( self::is_installed() && WC_Admin_Note::E_WC_ADMIN_NOTE_ACTIONED !== $note->get_status() ) {
|
||||
$note->set_status( WC_Admin_Note::E_WC_ADMIN_NOTE_ACTIONED );
|
||||
if ( self::is_installed() && Note::E_WC_ADMIN_NOTE_ACTIONED !== $note->get_status() ) {
|
||||
$note->set_status( Note::E_WC_ADMIN_NOTE_ACTIONED );
|
||||
$note->save();
|
||||
}
|
||||
|
||||
|
@ -94,21 +94,23 @@ class WC_Admin_Notes_WooCommerce_Payments {
|
|||
|
||||
/**
|
||||
* Add a note about WooCommerce Payments.
|
||||
*
|
||||
* @return Note
|
||||
*/
|
||||
public static function get_note() {
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
$note->set_title( __( 'Try the new way to get paid', 'woocommerce-admin' ) );
|
||||
$note->set_content( __( 'Securely accept credit and debit cards on your site. Manage transactions without leaving your WordPress dashboard. Only with WooCommerce Payments.', 'woocommerce-admin' ) );
|
||||
$note->set_content_data( (object) array() );
|
||||
$note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_MARKETING );
|
||||
$note->set_type( Note::E_WC_ADMIN_NOTE_MARKETING );
|
||||
$note->set_name( self::NOTE_NAME );
|
||||
$note->set_source( 'woocommerce-admin' );
|
||||
$note->add_action( 'learn-more', __( 'Learn more', 'woocommerce-admin' ), 'https://woocommerce.com/payments/', WC_Admin_Note::E_WC_ADMIN_NOTE_UNACTIONED );
|
||||
$note->add_action( 'install-now', __( 'Install now', 'woocommerce-admin' ), false, WC_Admin_Note::E_WC_ADMIN_NOTE_ACTIONED, true );
|
||||
$note->add_action( 'learn-more', __( 'Learn more', 'woocommerce-admin' ), 'https://woocommerce.com/payments/', Note::E_WC_ADMIN_NOTE_UNACTIONED );
|
||||
$note->add_action( 'install-now', __( 'Install now', 'woocommerce-admin' ), false, Note::E_WC_ADMIN_NOTE_ACTIONED, true );
|
||||
|
||||
// Create the note as "actioned" if the plugin is already installed.
|
||||
if ( self::is_installed() ) {
|
||||
$note->set_status( WC_Admin_Note::E_WC_ADMIN_NOTE_ACTIONED );
|
||||
$note->set_status( Note::E_WC_ADMIN_NOTE_ACTIONED );
|
||||
}
|
||||
return $note;
|
||||
}
|
||||
|
@ -128,7 +130,7 @@ class WC_Admin_Notes_WooCommerce_Payments {
|
|||
/**
|
||||
* Install WooCommerce Payments when note is actioned.
|
||||
*
|
||||
* @param WC_Admin_Note $note Note being acted upon.
|
||||
* @param Note $note Note being acted upon.
|
||||
*/
|
||||
public function install( $note ) {
|
||||
if ( self::NOTE_NAME === $note->get_name() && current_user_can( 'install_plugins' ) ) {
|
|
@ -12,9 +12,9 @@ defined( 'ABSPATH' ) || exit;
|
|||
use \Automattic\WooCommerce\Admin\Features\Onboarding;
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_WooCommerce_Subscriptions.
|
||||
* WooCommerce_Subscriptions.
|
||||
*/
|
||||
class WC_Admin_Notes_WooCommerce_Subscriptions {
|
||||
class WooCommerce_Subscriptions {
|
||||
/**
|
||||
* Note traits.
|
||||
*/
|
||||
|
@ -27,6 +27,8 @@ class WC_Admin_Notes_WooCommerce_Subscriptions {
|
|||
|
||||
/**
|
||||
* Get the note.
|
||||
*
|
||||
* @return Note|null
|
||||
*/
|
||||
public static function get_note() {
|
||||
$onboarding_data = get_option( Onboarding::PROFILE_DATA_OPTION, array() );
|
||||
|
@ -39,10 +41,10 @@ class WC_Admin_Notes_WooCommerce_Subscriptions {
|
|||
return;
|
||||
}
|
||||
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
$note->set_title( __( 'Do you need more info about WooCommerce Subscriptions?', 'woocommerce-admin' ) );
|
||||
$note->set_content( __( 'WooCommerce Subscriptions allows you to introduce a variety of subscriptions for physical or virtual products and services. Create product-of-the-month clubs, weekly service subscriptions or even yearly software billing packages. Add sign-up fees, offer free trials, or set expiration periods.', 'woocommerce-admin' ) );
|
||||
$note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_MARKETING );
|
||||
$note->set_type( Note::E_WC_ADMIN_NOTE_MARKETING );
|
||||
$note->set_name( self::NOTE_NAME );
|
||||
$note->set_content_data( (object) array() );
|
||||
$note->set_source( 'woocommerce-admin' );
|
||||
|
@ -50,7 +52,7 @@ class WC_Admin_Notes_WooCommerce_Subscriptions {
|
|||
'learn-more',
|
||||
__( 'Learn More', 'woocommerce-admin' ),
|
||||
'https://woocommerce.com/products/woocommerce-subscriptions/?utm_source=inbox',
|
||||
'actioned',
|
||||
Note::E_WC_ADMIN_NOTE_UNACTIONED,
|
||||
true
|
||||
);
|
||||
return $note;
|
|
@ -10,9 +10,9 @@ namespace Automattic\WooCommerce\Admin\Notes;
|
|||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Woo_Subscriptions_Notes
|
||||
* Woo_Subscriptions_Notes
|
||||
*/
|
||||
class WC_Admin_Notes_Woo_Subscriptions_Notes {
|
||||
class Woo_Subscriptions_Notes {
|
||||
const LAST_REFRESH_OPTION_KEY = 'woocommerce_admin-wc-helper-last-refresh';
|
||||
const CONNECTION_NOTE_NAME = 'wc-admin-wc-helper-connection';
|
||||
const SUBSCRIPTION_NOTE_NAME = 'wc-admin-wc-helper-subscription';
|
||||
|
@ -170,26 +170,26 @@ class WC_Admin_Notes_Woo_Subscriptions_Notes {
|
|||
* Clears all connection or subscription notes.
|
||||
*/
|
||||
public function remove_notes() {
|
||||
WC_Admin_Notes::delete_notes_with_name( self::CONNECTION_NOTE_NAME );
|
||||
WC_Admin_Notes::delete_notes_with_name( self::SUBSCRIPTION_NOTE_NAME );
|
||||
Notes::delete_notes_with_name( self::CONNECTION_NOTE_NAME );
|
||||
Notes::delete_notes_with_name( self::SUBSCRIPTION_NOTE_NAME );
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a note prompting to connect to WooCommerce.com.
|
||||
*/
|
||||
public function add_no_connection_note() {
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
$note->set_title( __( 'Connect to WooCommerce.com', 'woocommerce-admin' ) );
|
||||
$note->set_content( __( 'Connect to get important product notifications and updates.', 'woocommerce-admin' ) );
|
||||
$note->set_content_data( (object) array() );
|
||||
$note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_name( self::CONNECTION_NOTE_NAME );
|
||||
$note->set_source( 'woocommerce-admin' );
|
||||
$note->add_action(
|
||||
'connect',
|
||||
__( 'Connect', 'woocommerce-admin' ),
|
||||
'?page=wc-addons§ion=helper',
|
||||
WC_Admin_Note::E_WC_ADMIN_NOTE_UNACTIONED
|
||||
Note::E_WC_ADMIN_NOTE_UNACTIONED
|
||||
);
|
||||
$note->save();
|
||||
}
|
||||
|
@ -197,7 +197,7 @@ class WC_Admin_Notes_Woo_Subscriptions_Notes {
|
|||
/**
|
||||
* Gets the product_id (if any) associated with a note.
|
||||
*
|
||||
* @param WC_Admin_Note $note The note object to interrogate.
|
||||
* @param Note $note The note object to interrogate.
|
||||
* @return int|false
|
||||
*/
|
||||
public function get_product_id_from_subscription_note( &$note ) {
|
||||
|
@ -220,7 +220,7 @@ class WC_Admin_Notes_Woo_Subscriptions_Notes {
|
|||
$note_ids = $data_store->get_notes_with_name( self::SUBSCRIPTION_NOTE_NAME );
|
||||
|
||||
foreach ( (array) $note_ids as $note_id ) {
|
||||
$note = WC_Admin_Notes::get_note( $note_id );
|
||||
$note = Notes::get_note( $note_id );
|
||||
$product_id = $this->get_product_id_from_subscription_note( $note );
|
||||
if ( ! empty( $product_id ) ) {
|
||||
if ( ! in_array( $product_id, $active_product_ids, true ) ) {
|
||||
|
@ -234,7 +234,7 @@ class WC_Admin_Notes_Woo_Subscriptions_Notes {
|
|||
* Finds a note for a given product ID, if the note exists at all.
|
||||
*
|
||||
* @param int $product_id The product ID to search for.
|
||||
* @return WC_Admin_Note|false
|
||||
* @return Note|false
|
||||
*/
|
||||
public function find_note_for_product_id( $product_id ) {
|
||||
$product_id = intval( $product_id );
|
||||
|
@ -242,7 +242,7 @@ class WC_Admin_Notes_Woo_Subscriptions_Notes {
|
|||
$data_store = \WC_Data_Store::load( 'admin-note' );
|
||||
$note_ids = $data_store->get_notes_with_name( self::SUBSCRIPTION_NOTE_NAME );
|
||||
foreach ( (array) $note_ids as $note_id ) {
|
||||
$note = WC_Admin_Notes::get_note( $note_id );
|
||||
$note = Notes::get_note( $note_id );
|
||||
$found_product_id = $this->get_product_id_from_subscription_note( $note );
|
||||
|
||||
if ( $product_id === $found_product_id ) {
|
||||
|
@ -326,12 +326,12 @@ class WC_Admin_Notes_Woo_Subscriptions_Notes {
|
|||
);
|
||||
|
||||
if ( ! $note ) {
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
}
|
||||
|
||||
// Reset everything in case we are repurposing an expired note as an expiring note.
|
||||
$note->set_title( $note_title );
|
||||
$note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_WARNING );
|
||||
$note->set_type( Note::E_WC_ADMIN_NOTE_WARNING );
|
||||
$note->set_name( self::SUBSCRIPTION_NOTE_NAME );
|
||||
$note->set_source( 'woocommerce-admin' );
|
||||
$note->clear_actions();
|
||||
|
@ -388,13 +388,13 @@ class WC_Admin_Notes_Woo_Subscriptions_Notes {
|
|||
);
|
||||
|
||||
if ( ! $note ) {
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
}
|
||||
|
||||
$note->set_title( $note_title );
|
||||
$note->set_content( $note_content );
|
||||
$note->set_content_data( $note_content_data );
|
||||
$note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_WARNING );
|
||||
$note->set_type( Note::E_WC_ADMIN_NOTE_WARNING );
|
||||
$note->set_name( self::SUBSCRIPTION_NOTE_NAME );
|
||||
$note->set_source( 'woocommerce-admin' );
|
||||
$note->clear_actions();
|
|
@ -11,7 +11,7 @@ namespace Automattic\WooCommerce\Admin\Composer;
|
|||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
use Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Deactivate_Plugin;
|
||||
use Automattic\WooCommerce\Admin\Notes\Deactivate_Plugin;
|
||||
use Automattic\WooCommerce\Admin\FeaturePlugin;
|
||||
|
||||
/**
|
||||
|
@ -49,7 +49,7 @@ class Package {
|
|||
// Avoid double initialization when the feature plugin is in use.
|
||||
if ( defined( 'WC_ADMIN_VERSION_NUMBER' ) ) {
|
||||
self::$active_version = WC_ADMIN_VERSION_NUMBER;
|
||||
$update_version = new WC_Admin_Notes_Deactivate_Plugin();
|
||||
$update_version = new Deactivate_Plugin();
|
||||
if ( version_compare( WC_ADMIN_VERSION_NUMBER, self::VERSION, '<' ) ) {
|
||||
if ( method_exists( $update_version, 'possibly_add_note' ) ) {
|
||||
$update_version::possibly_add_note();
|
||||
|
@ -123,7 +123,7 @@ class Package {
|
|||
* Add deactivation hook for versions of the plugin that don't have the deactivation note.
|
||||
*/
|
||||
public static function on_deactivation() {
|
||||
$update_version = new WC_Admin_Notes_Deactivate_Plugin();
|
||||
$update_version = new Deactivate_Plugin();
|
||||
$update_version::delete_note();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;
|
|||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Note;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Note;
|
||||
|
||||
/**
|
||||
* Evaluates the spec and returns a status.
|
||||
|
@ -33,10 +33,10 @@ class EvaluateAndGetStatus {
|
|||
|
||||
// Pending notes should be the spec status if the spec passes,
|
||||
// left alone otherwise.
|
||||
if ( WC_Admin_Note::E_WC_ADMIN_NOTE_PENDING === $current_status ) {
|
||||
if ( Note::E_WC_ADMIN_NOTE_PENDING === $current_status ) {
|
||||
return $evaluated_result
|
||||
? $spec->status
|
||||
: WC_Admin_Note::E_WC_ADMIN_NOTE_PENDING;
|
||||
: Note::E_WC_ADMIN_NOTE_PENDING;
|
||||
}
|
||||
|
||||
// When allow_redisplay isn't set, just leave the note alone.
|
||||
|
@ -46,7 +46,7 @@ class EvaluateAndGetStatus {
|
|||
|
||||
// allow_redisplay is set, unaction the note if eval to true.
|
||||
return $evaluated_result
|
||||
? WC_Admin_Note::E_WC_ADMIN_NOTE_UNACTIONED
|
||||
? Note::E_WC_ADMIN_NOTE_UNACTIONED
|
||||
: $current_status;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,8 +7,8 @@ namespace Automattic\WooCommerce\Admin\RemoteInboxNotifications;
|
|||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Note;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Note;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Notes;
|
||||
|
||||
/**
|
||||
* Runs a single spec.
|
||||
|
@ -26,10 +26,10 @@ class SpecRunner {
|
|||
// Create or update the note.
|
||||
$existing_note_ids = $data_store->get_notes_with_name( $spec->slug );
|
||||
if ( 0 === count( $existing_note_ids ) ) {
|
||||
$note = new WC_Admin_Note();
|
||||
$note->set_status( WC_Admin_Note::E_WC_ADMIN_NOTE_PENDING );
|
||||
$note = new Note();
|
||||
$note->set_status( Note::E_WC_ADMIN_NOTE_PENDING );
|
||||
} else {
|
||||
$note = WC_Admin_Notes::get_note( $existing_note_ids[0] );
|
||||
$note = Notes::get_note( $existing_note_ids[0] );
|
||||
if ( false === $note ) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
* @package WooCommerce\Admin\Tests\API
|
||||
*/
|
||||
|
||||
use Automattic\WooCommerce\Admin\Notes\WC_Admin_Note;
|
||||
use Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes;
|
||||
use Automattic\WooCommerce\Admin\Notes\Note;
|
||||
use Automattic\WooCommerce\Admin\Notes\Notes;
|
||||
|
||||
/**
|
||||
* Class WC_Tests_API_Admin_Notes
|
||||
|
@ -64,14 +64,14 @@ class WC_Tests_API_Admin_Notes extends WC_REST_Unit_Test_Case {
|
|||
|
||||
$this->assertEquals( 1, $note['id'] );
|
||||
$this->assertEquals( 'PHPUNIT_TEST_NOTE_NAME', $note['name'] );
|
||||
$this->assertEquals( WC_Admin_Note::E_WC_ADMIN_NOTE_INFORMATIONAL, $note['type'] );
|
||||
$this->assertEquals( Note::E_WC_ADMIN_NOTE_INFORMATIONAL, $note['type'] );
|
||||
$this->assertArrayHasKey( 'locale', $note );
|
||||
$this->assertEquals( 'PHPUNIT_TEST_NOTE_1_TITLE', $note['title'] );
|
||||
|
||||
$this->assertEquals( 'PHPUNIT_TEST_NOTE_1_CONTENT', $note['content'] );
|
||||
$this->assertArrayHasKey( 'content_data', $note );
|
||||
$this->assertEquals( 1.23, $note['content_data']->amount );
|
||||
$this->assertEquals( WC_Admin_Note::E_WC_ADMIN_NOTE_UNACTIONED, $note['status'] );
|
||||
$this->assertEquals( Note::E_WC_ADMIN_NOTE_UNACTIONED, $note['status'] );
|
||||
$this->assertEquals( 'PHPUNIT_TEST', $note['source'] );
|
||||
|
||||
$this->assertArrayHasKey( 'date_created', $note );
|
||||
|
@ -230,7 +230,7 @@ class WC_Tests_API_Admin_Notes extends WC_REST_Unit_Test_Case {
|
|||
$this->assertEquals( $notes[0]['title'], 'PHPUNIT_TEST_NOTE_3_TITLE' );
|
||||
|
||||
// The test snoozed note's reminder date is an hour ago.
|
||||
WC_Admin_Notes::unsnooze_notes();
|
||||
Notes::unsnooze_notes();
|
||||
|
||||
$response = $this->server->dispatch( $request );
|
||||
$notes = $response->get_data();
|
||||
|
@ -273,10 +273,10 @@ class WC_Tests_API_Admin_Notes extends WC_REST_Unit_Test_Case {
|
|||
$notes = $response->get_data();
|
||||
|
||||
$this->assertEquals( 4, count( $notes ) );
|
||||
$this->assertEquals( $notes[0]['status'], WC_Admin_Note::E_WC_ADMIN_NOTE_UNACTIONED );
|
||||
$this->assertEquals( $notes[1]['status'], WC_Admin_Note::E_WC_ADMIN_NOTE_UNACTIONED );
|
||||
$this->assertEquals( $notes[2]['status'], WC_Admin_Note::E_WC_ADMIN_NOTE_SNOOZED );
|
||||
$this->assertEquals( $notes[3]['status'], WC_Admin_Note::E_WC_ADMIN_NOTE_ACTIONED );
|
||||
$this->assertEquals( $notes[0]['status'], Note::E_WC_ADMIN_NOTE_UNACTIONED );
|
||||
$this->assertEquals( $notes[1]['status'], Note::E_WC_ADMIN_NOTE_UNACTIONED );
|
||||
$this->assertEquals( $notes[2]['status'], Note::E_WC_ADMIN_NOTE_SNOOZED );
|
||||
$this->assertEquals( $notes[3]['status'], Note::E_WC_ADMIN_NOTE_ACTIONED );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* @package WooCommerce\Admin\Tests\Framework\Helpers
|
||||
*/
|
||||
|
||||
use Automattic\WooCommerce\Admin\Notes\WC_Admin_Note;
|
||||
use Automattic\WooCommerce\Admin\Notes\Note;
|
||||
|
||||
/**
|
||||
* Class WC_Helper_Admin_Notes.
|
||||
|
@ -29,11 +29,11 @@ class WC_Helper_Admin_Notes {
|
|||
public static function add_notes_for_tests() {
|
||||
$data_store = WC_Data_Store::load( 'admin-note' );
|
||||
|
||||
$note_1 = new WC_Admin_Note();
|
||||
$note_1 = new Note();
|
||||
$note_1->set_title( 'PHPUNIT_TEST_NOTE_1_TITLE' );
|
||||
$note_1->set_content( 'PHPUNIT_TEST_NOTE_1_CONTENT' );
|
||||
$note_1->set_content_data( (object) array( 'amount' => 1.23 ) );
|
||||
$note_1->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note_1->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note_1->set_name( 'PHPUNIT_TEST_NOTE_NAME' );
|
||||
$note_1->set_source( 'PHPUNIT_TEST' );
|
||||
$note_1->set_is_snoozable( false );
|
||||
|
@ -51,39 +51,39 @@ class WC_Helper_Admin_Notes {
|
|||
);
|
||||
$note_1->save();
|
||||
|
||||
$note_2 = new WC_Admin_Note();
|
||||
$note_2 = new Note();
|
||||
$note_2->set_title( 'PHPUNIT_TEST_NOTE_2_TITLE' );
|
||||
$note_2->set_content( 'PHPUNIT_TEST_NOTE_2_CONTENT' );
|
||||
$note_2->set_content_data( (object) array( 'amount' => 4.56 ) );
|
||||
$note_2->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_WARNING );
|
||||
$note_2->set_type( Note::E_WC_ADMIN_NOTE_WARNING );
|
||||
$note_2->set_name( 'PHPUNIT_TEST_NOTE_NAME' );
|
||||
$note_2->set_source( 'PHPUNIT_TEST' );
|
||||
$note_2->set_status( WC_Admin_Note::E_WC_ADMIN_NOTE_ACTIONED );
|
||||
$note_2->set_status( Note::E_WC_ADMIN_NOTE_ACTIONED );
|
||||
$note_2->set_is_snoozable( true );
|
||||
$note_2->set_layout( 'banner' );
|
||||
$note_2->set_image( 'https://an-image.jpg' );
|
||||
// This note has no actions.
|
||||
$note_2->save();
|
||||
|
||||
$note_3 = new WC_Admin_Note();
|
||||
$note_3 = new Note();
|
||||
$note_3->set_title( 'PHPUNIT_TEST_NOTE_3_TITLE' );
|
||||
$note_3->set_content( 'PHPUNIT_TEST_NOTE_3_CONTENT' );
|
||||
$note_3->set_content_data( (object) array( 'amount' => 7.89 ) );
|
||||
$note_3->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note_3->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note_3->set_name( 'PHPUNIT_TEST_NOTE_NAME' );
|
||||
$note_3->set_source( 'PHPUNIT_TEST' );
|
||||
$note_3->set_status( WC_Admin_Note::E_WC_ADMIN_NOTE_SNOOZED );
|
||||
$note_3->set_status( Note::E_WC_ADMIN_NOTE_SNOOZED );
|
||||
$note_3->set_date_reminder( time() - HOUR_IN_SECONDS );
|
||||
$note_3->set_layout( 'thumbnail' );
|
||||
$note_3->set_image( 'https://an-image.jpg' );
|
||||
// This note has no actions.
|
||||
$note_3->save();
|
||||
|
||||
$note_4 = new WC_Admin_Note();
|
||||
$note_4 = new Note();
|
||||
$note_4->set_title( 'PHPUNIT_TEST_NOTE_4_TITLE' );
|
||||
$note_4->set_content( 'PHPUNIT_TEST_NOTE_4_CONTENT' );
|
||||
$note_4->set_content_data( (object) array( 'amount' => 1.23 ) );
|
||||
$note_4->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note_4->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note_4->set_name( 'PHPUNIT_TEST_NOTE_NAME' );
|
||||
$note_4->set_source( 'PHPUNIT_TEST' );
|
||||
$note_4->set_is_snoozable( false );
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
* @package WooCommerce\Admin\Tests\Notes
|
||||
*/
|
||||
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Note;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_WooCommerce_Payments;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Notes;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Note;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WooCommerce_Payments;
|
||||
|
||||
/**
|
||||
* Class WC_Tests_Marketing_Notes
|
||||
|
@ -20,10 +20,10 @@ class WC_Tests_Marketing_Notes extends WC_Unit_Test_Case {
|
|||
public function test_add_remove_marketing_note() {
|
||||
$data_store = \WC_Data_Store::load( 'admin-note' );
|
||||
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
$note->set_title( 'PHPUNIT_TEST_MARKETING_NOTE' );
|
||||
$note->set_content( 'PHPUNIT_TEST_MARKETING_NOTE_CONTENT' );
|
||||
$note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_MARKETING );
|
||||
$note->set_type( Note::E_WC_ADMIN_NOTE_MARKETING );
|
||||
$note->set_name( 'PHPUNIT_TEST_MARKETING_NOTE_NAME' );
|
||||
$note->set_source( 'PHPUNIT_TEST' );
|
||||
$note->set_is_snoozable( false );
|
||||
|
@ -32,7 +32,7 @@ class WC_Tests_Marketing_Notes extends WC_Unit_Test_Case {
|
|||
// Load all marketing notes and check that the note was successfully saved.
|
||||
$notes = $data_store->get_notes(
|
||||
array(
|
||||
'type' => array( WC_Admin_Note::E_WC_ADMIN_NOTE_MARKETING ),
|
||||
'type' => array( Note::E_WC_ADMIN_NOTE_MARKETING ),
|
||||
)
|
||||
);
|
||||
|
||||
|
@ -44,7 +44,7 @@ class WC_Tests_Marketing_Notes extends WC_Unit_Test_Case {
|
|||
// Reload all marketing notes to verify they have been removed.
|
||||
$notes = $data_store->get_notes(
|
||||
array(
|
||||
'type' => array( WC_Admin_Note::E_WC_ADMIN_NOTE_MARKETING ),
|
||||
'type' => array( Note::E_WC_ADMIN_NOTE_MARKETING ),
|
||||
)
|
||||
);
|
||||
|
||||
|
@ -61,13 +61,13 @@ class WC_Tests_Marketing_Notes extends WC_Unit_Test_Case {
|
|||
// Set user preferences to disallow marketing suggestions.
|
||||
update_option( 'woocommerce_show_marketplace_suggestions', 'no' );
|
||||
|
||||
WC_Admin_Notes_WooCommerce_Payments::possibly_add_note();
|
||||
WooCommerce_Payments::possibly_add_note();
|
||||
|
||||
// Load all marketing notes and check that the note was not added.
|
||||
$data_store = \WC_Data_Store::load( 'admin-note' );
|
||||
$notes = $data_store->get_notes(
|
||||
array(
|
||||
'type' => array( WC_Admin_Note::E_WC_ADMIN_NOTE_MARKETING ),
|
||||
'type' => array( Note::E_WC_ADMIN_NOTE_MARKETING ),
|
||||
)
|
||||
);
|
||||
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
* @package WooCommerce\Admin\Tests\Notes
|
||||
*/
|
||||
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes;
|
||||
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Note;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Notes;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Note;
|
||||
|
||||
/**
|
||||
* Class WC_Tests_Notes_Data_Store
|
||||
|
@ -17,10 +17,10 @@ class WC_Tests_Notes_Data_Store extends WC_Unit_Test_Case {
|
|||
* Tests that the read data store method works as expected.
|
||||
*/
|
||||
public function test_read() {
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
$note->set_title( 'PHPUNIT_TEST_NOTE' );
|
||||
$note->set_content( 'PHPUNIT_TEST_NOTE_CONTENT' );
|
||||
$note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_name( 'PHPUNIT_TEST_NOTE_NAME' );
|
||||
$note->set_source( 'PHPUNIT_TEST' );
|
||||
$note->set_is_snoozable( false );
|
||||
|
@ -35,7 +35,7 @@ class WC_Tests_Notes_Data_Store extends WC_Unit_Test_Case {
|
|||
$note->save();
|
||||
|
||||
// Load in a new instance of the note.
|
||||
$read_note = new WC_Admin_Note();
|
||||
$read_note = new Note();
|
||||
$read_note->set_id( $note->get_id() );
|
||||
WC_Data_Store::load( 'admin-note' )->read( $read_note );
|
||||
|
||||
|
@ -58,7 +58,7 @@ class WC_Tests_Notes_Data_Store extends WC_Unit_Test_Case {
|
|||
global $wpdb;
|
||||
$data_store = WC_Data_Store::load( 'admin-note' );
|
||||
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
$note->set_title( 'PHPUNIT_TEST_NOTE' );
|
||||
$note->set_content( 'PHPUNIT_TEST_NOTE_CONTENT' );
|
||||
$note->save();
|
||||
|
@ -107,7 +107,7 @@ class WC_Tests_Notes_Data_Store extends WC_Unit_Test_Case {
|
|||
// Create notes.
|
||||
foreach ( $note_names as $note_name ) {
|
||||
for ( $i = 0; $i < 3; $i++ ) {
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
$note->set_name( $note_name );
|
||||
$note->set_title( 'PHPUNIT_TEST_NOTE' );
|
||||
$note->set_content( 'PHPUNIT_TEST_NOTE_CONTENT' );
|
||||
|
@ -126,7 +126,7 @@ class WC_Tests_Notes_Data_Store extends WC_Unit_Test_Case {
|
|||
);
|
||||
|
||||
// Delete the notes.
|
||||
WC_Admin_Notes::delete_notes_with_name( $note_name_to_delete );
|
||||
Notes::delete_notes_with_name( $note_name_to_delete );
|
||||
|
||||
// Make sure the notes were deleted.
|
||||
$this->assertEquals(
|
||||
|
@ -158,7 +158,7 @@ class WC_Tests_Notes_Data_Store extends WC_Unit_Test_Case {
|
|||
// Create notes.
|
||||
foreach ( $note_names as $note_name ) {
|
||||
for ( $i = 0; $i < 3; $i++ ) {
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
$note->set_name( $note_name );
|
||||
$note->set_title( 'PHPUNIT_TEST_NOTE' );
|
||||
$note->set_content( 'PHPUNIT_TEST_NOTE_CONTENT' );
|
||||
|
@ -181,7 +181,7 @@ class WC_Tests_Notes_Data_Store extends WC_Unit_Test_Case {
|
|||
);
|
||||
|
||||
// Delete the notes.
|
||||
WC_Admin_Notes::delete_notes_with_name(
|
||||
Notes::delete_notes_with_name(
|
||||
array(
|
||||
$note_name_to_delete_1,
|
||||
$note_name_to_delete_2,
|
||||
|
@ -208,7 +208,7 @@ class WC_Tests_Notes_Data_Store extends WC_Unit_Test_Case {
|
|||
*/
|
||||
public function test_read_throws_exception() {
|
||||
// Create a test note.
|
||||
$note = new WC_Admin_Note();
|
||||
$note = new Note();
|
||||
$note->set_name( 'PHPUNIT_TEST_NOTE_NAME' );
|
||||
$note->set_title( 'PHPUNIT_TEST_NOTE_TITLE' );
|
||||
$note->set_content( 'PHPUNIT_TEST_NOTE_CONTENT' );
|
||||
|
@ -232,7 +232,7 @@ class WC_Tests_Notes_Data_Store extends WC_Unit_Test_Case {
|
|||
add_filter( 'woocommerce_admin-note_data_store', $filter_datastore );
|
||||
|
||||
// Attempt to retrieve the test note.
|
||||
$note = WC_Admin_Notes::get_note( $note_id );
|
||||
$note = Notes::get_note( $note_id );
|
||||
|
||||
remove_filter( 'woocommerce_admin-note_data_store', $filter_datastore );
|
||||
|
||||
|
|
Loading…
Reference in New Issue