WPSEO_Dismissible_Notification::handle()publicYoast 1.0

Adds the notification if applicable, otherwise removes it.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

$WPSEO_Dismissible_Notification = new WPSEO_Dismissible_Notification();
$WPSEO_Dismissible_Notification->handle( $notification_center );
$notification_center(Yoast_Notification_Center) (обязательный)
The notification center object.

Код WPSEO_Dismissible_Notification::handle() Yoast 24.1

public function handle( Yoast_Notification_Center $notification_center ) {
	if ( $this->is_applicable() ) {
		$notification = $this->get_notification();
		$notification_center->add_notification( $notification );

		return;
	}

	$notification_center->remove_notification_by_id( 'wpseo-' . $this->notification_identifier );
}