Yoast\WP\SEO\Llms_Txt\User_Interface

File_Failure_Llms_Txt_Notification_Integration::maybe_add_file_failure_notificationprivateYoast 1.0

Add the search engines discouraged notification if it does not exist yet.

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

Хуков нет.

Возвращает

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

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

// private - только в коде основоного (родительского) класса
$result = $this->maybe_add_file_failure_notification();

Код File_Failure_Llms_Txt_Notification_Integration::maybe_add_file_failure_notification() Yoast 28.0

private function maybe_add_file_failure_notification() {
	if ( ! $this->notification_center->get_notification_by_id( self::NOTIFICATION_ID ) ) {
		$notification = new Yoast_Notification(
			$this->presenter->present(),
			[
				'type'         => Yoast_Notification::ERROR,
				'id'           => self::NOTIFICATION_ID,
				'capabilities' => 'wpseo_manage_options',
				'priority'     => 1,
			],
		);
		$this->notification_center->restore_notification( $notification );
		$this->notification_center->add_notification( $notification );
	}
}