2019-05-14 14:33:45 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2019-05-14 22:08:13 +00:00
|
|
|
* Handle cron events.
|
2019-05-14 14:33:45 +00:00
|
|
|
* NOTE: DO NOT edit this file in WooCommerce core, this is generated from woocommerce-admin.
|
|
|
|
*
|
|
|
|
* @package Woocommerce Admin
|
|
|
|
*/
|
|
|
|
|
2019-08-06 19:36:15 +00:00
|
|
|
namespace Automattic\WooCommerce\Admin;
|
|
|
|
|
2019-05-14 14:33:45 +00:00
|
|
|
defined( 'ABSPATH' ) || exit;
|
|
|
|
|
2019-08-15 02:32:59 +00:00
|
|
|
use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Facebook_Extension;
|
2019-08-06 19:36:15 +00:00
|
|
|
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;
|
|
|
|
|
2019-05-14 14:33:45 +00:00
|
|
|
/**
|
|
|
|
* WC_Admin_Events Class.
|
|
|
|
*/
|
2019-08-12 21:52:09 +00:00
|
|
|
class Events {
|
2019-05-14 14:33:45 +00:00
|
|
|
/**
|
|
|
|
* The single instance of the class.
|
|
|
|
*
|
|
|
|
* @var object
|
|
|
|
*/
|
|
|
|
protected static $instance = null;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
protected function __construct() {}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get class instance.
|
|
|
|
*
|
|
|
|
* @return object Instance.
|
|
|
|
*/
|
|
|
|
final public static function instance() {
|
|
|
|
if ( null === static::$instance ) {
|
|
|
|
static::$instance = new static();
|
|
|
|
}
|
|
|
|
return static::$instance;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Cron event handlers.
|
|
|
|
*/
|
|
|
|
public function init() {
|
2019-05-14 22:09:02 +00:00
|
|
|
add_action( 'wc_admin_daily', array( $this, 'do_wc_admin_daily' ) );
|
2019-05-14 14:33:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Daily events to run.
|
|
|
|
*
|
|
|
|
* Note: WC_Admin_Notes_Order_Milestones::other_milestones is hooked to this as well.
|
|
|
|
*/
|
2019-06-12 02:37:45 +00:00
|
|
|
public function do_wc_admin_daily() {
|
2019-05-14 14:33:45 +00:00
|
|
|
WC_Admin_Notes_New_Sales_Record::possibly_add_sales_record_note();
|
|
|
|
WC_Admin_Notes_Giving_Feedback_Notes::add_notes_for_admin_giving_feedback();
|
|
|
|
WC_Admin_Notes_Mobile_App::possibly_add_mobile_app_note();
|
2019-08-15 02:32:59 +00:00
|
|
|
WC_Admin_Notes_Facebook_Extension::possibly_add_facebook_note();
|
2019-05-14 14:33:45 +00:00
|
|
|
}
|
|
|
|
}
|