WPSEO_Upgrade::remove_about_notice()publicYoast 1.0

Removes the wpseo-dismiss-about notice from a list of notifications.

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

Хуков нет.

Возвращает

Yoast_Notification[]. The filtered list of notifications. Excluding the wpseo-dismiss-about notification.

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

$WPSEO_Upgrade = new WPSEO_Upgrade();
$WPSEO_Upgrade->remove_about_notice( $notifications );
$notifications(Yoast_Notification[]) (обязательный)
The notifications to filter.

Код WPSEO_Upgrade::remove_about_notice() Yoast 22.1

public function remove_about_notice( $notifications ) {
	foreach ( $notifications as $notification_key => $notification ) {
		if ( $notification->get_id() === 'wpseo-dismiss-about' ) {
			unset( $notifications[ $notification_key ] );
		}
	}

	return $notifications;
}