WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

Yoast_Notification_Center::remove_notification() public Yoast 1.0

Remove notification after it has been displayed.

Ищем WP-разработчика! Фулл-тайм, удаленка, хорошая зарплата, соц. пакет. Подробности.
Компания Boosta.

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

Хуков нет.

Возвращает

null. Ничего.

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

$Yoast_Notification_Center = new Yoast_Notification_Center();
$Yoast_Notification_Center->remove_notification( $notification, $resolve );
$notification(Yoast_Notification) (обязательный)
Notification to remove.
$resolve(true|false)
Resolve as fixed.
По умолчанию: true

Код Yoast_Notification_Center::remove_notification() Yoast 17.4

public function remove_notification( Yoast_Notification $notification, $resolve = true ) {

	$callback = [ $this, __METHOD__ ];
	$args     = func_get_args();
	if ( $this->queue_transaction( $callback, $args ) ) {
		return;
	}

	$index = false;

	// ID of the user to show the notification for, defaults to current user id.
	$user_id       = $notification->get_user_id();
	$notifications = $this->get_notifications_for_user( $user_id );

	// Match persistent Notifications by ID, non persistent by item in the array.
	if ( $notification->is_persistent() ) {
		foreach ( $notifications as $current_index => $present_notification ) {
			if ( $present_notification->get_id() === $notification->get_id() ) {
				$index = $current_index;
				break;
			}
		}
	}
	else {
		$index = array_search( $notification, $notifications, true );
	}

	if ( $index === false ) {
		return;
	}

	if ( $notification->is_persistent() && $resolve ) {
		++$this->resolved;
		$this->clear_dismissal( $notification );
	}

	unset( $notifications[ $index ] );
	$this->notifications[ $user_id ] = array_values( $notifications );

	$this->notifications_need_storage = true;
}