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. Ничего (null).


$Yoast_Notification_Center = new Yoast_Notification_Center();

Код Yoast_Notification_Center::setup_current_notifications() Yoast 22.8

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 = [];