Yoast_Notification_Center::setup_current_notifications()publicYoast 1.0

Retrieves notifications from the storage and merges in previous notification changes.

The current user in WordPress is not loaded shortly before the 'init' hook, but the plugin sometimes needs to add or remove notifications before that. In such cases, the transactions are not actually executed, but added to a queue. That queue is then handled in this method, after notifications for the current user have been set up.

{} Это метод класса: Yoast_Notification_Center{}

Хуков нет.

Возвращает

null. Ничего.

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

$Yoast_Notification_Center = new Yoast_Notification_Center();
$Yoast_Notification_Center->setup_current_notifications();

Код Yoast_Notification_Center::setup_current_notifications() Yoast 19.6.1

public function setup_current_notifications() {
	$this->retrieve_notifications_from_storage( get_current_user_id() );

	foreach ( $this->queued_transactions as $transaction ) {
		list( $callback, $args ) = $transaction;

		call_user_func_array( $callback, $args );
	}

	$this->queued_transactions = [];
}