Automattic\WooCommerce\Internal\Admin\Schedulers
OrdersScheduler::init
Attach order lookup update hooks.
Метод класса: OrdersScheduler{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$result = OrdersScheduler::init();
Код OrdersScheduler::init() OrdersScheduler::init WC 10.8.1
public static function init() {
// Activate WC_Order extension.
\Automattic\WooCommerce\Admin\Overrides\Order::add_filters();
\Automattic\WooCommerce\Admin\Overrides\OrderRefund::add_filters();
if ( self::is_scheduled_import_enabled() ) {
// Schedule recurring batch processor.
add_action( 'action_scheduler_ensure_recurring_actions', array( __CLASS__, 'schedule_recurring_batch_processor' ) );
} else {
// Schedule import immediately on order create/update/delete.
add_action( 'woocommerce_update_order', array( __CLASS__, 'possibly_schedule_import' ) );
add_filter( 'woocommerce_create_order', array( __CLASS__, 'possibly_schedule_import' ) );
add_action( 'woocommerce_refund_created', array( __CLASS__, 'possibly_schedule_import' ) );
add_action( 'woocommerce_schedule_import', array( __CLASS__, 'possibly_schedule_import' ) );
}
if ( Features::is_enabled( 'analytics-scheduled-import' ) ) {
// Watch for changes to the scheduled import option.
add_action( 'add_option_' . self::SCHEDULED_IMPORT_OPTION, array( __CLASS__, 'handle_scheduled_import_option_added' ), 10, 2 );
add_action( 'update_option_' . self::SCHEDULED_IMPORT_OPTION, array( __CLASS__, 'handle_scheduled_import_option_change' ), 10, 2 );
add_action( 'delete_option', array( __CLASS__, 'handle_scheduled_import_option_before_delete' ), 10, 1 );
}
OrdersStatsDataStore::init();
CouponsDataStore::init();
ProductsDataStore::init();
TaxesDataStore::init();
OrderDataStore::init();
parent::init();
}