Automattic\WooCommerce\Admin\RemoteInboxNotifications

RemoteInboxNotificationsEngine::init()public staticWC 1.0

Initialize the engine.

Метод класса: RemoteInboxNotificationsEngine{}

Хуков нет.

Возвращает

null. Ничего.

Использование

$result = RemoteInboxNotificationsEngine::init();

Код RemoteInboxNotificationsEngine::init() WC 7.3.0

public static function init() {
	// Init things that need to happen before admin_init.
	add_action( 'init', array( __CLASS__, 'on_init' ), 0, 0 );

	// Continue init via admin_init.
	add_action( 'admin_init', array( __CLASS__, 'on_admin_init' ) );

	// Trigger when the profile data option is updated (during onboarding).
	add_action(
		'update_option_' . OnboardingProfile::DATA_OPTION,
		array( __CLASS__, 'update_profile_option' ),
		10,
		2
	);

	// Hook into WCA updated. This is hooked up here rather than in
	// on_admin_init because that runs too late to hook into the action.
	add_action(
		'woocommerce_updated',
		function() {
			$next_hook = WC()->queue()->get_next(
				'woocommerce_run_on_woocommerce_admin_updated',
				array( __CLASS__, 'run_on_woocommerce_admin_updated' ),
				'woocommerce-remote-inbox-engine'
			);
			if ( $next_hook === null ) {
				WC()->queue()->schedule_single(
					time(),
					'woocommerce_run_on_woocommerce_admin_updated',
					array( __CLASS__, 'run_on_woocommerce_admin_updated' ),
					'woocommerce-remote-inbox-engine'
				);
			}
		}
	);

	add_filter( 'woocommerce_get_note_from_db', array( __CLASS__, 'get_note_from_db' ), 10, 1 );
}