WPSEO_Admin_Gutenberg_Compatibility_Notification::add_notification
Adds the notification to the notificaton center.
Метод класса: WPSEO_Admin_Gutenberg_Compatibility_Notification{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->add_notification();
Код WPSEO_Admin_Gutenberg_Compatibility_Notification::add_notification() WPSEO Admin Gutenberg Compatibility Notification::add notification Yoast 27.5
protected function add_notification() {
$level = $this->compatibility_checker->is_below_minimum() ? Yoast_Notification::ERROR : Yoast_Notification::WARNING;
$message = sprintf(
/* translators: %1$s expands to Yoast SEO, %2$s expands to the installed version, %3$s expands to Gutenberg */
__( '%1$s detected you are using version %2$s of %3$s, please update to the latest version to prevent compatibility issues.', 'wordpress-seo' ),
'Yoast SEO',
$this->compatibility_checker->get_installed_version(),
'Gutenberg',
);
$notification = new Yoast_Notification(
$message,
[
'id' => $this->notification_id,
'type' => $level,
'priority' => 1,
],
);
$this->notification_center->add_notification( $notification );
}