WPSEO_Suggested_Plugins::add_notifications()publicYoast 1.0

Adds notifications (when necessary).

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

Хуков нет.

Возвращает

null. Ничего.

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

$WPSEO_Suggested_Plugins = new WPSEO_Suggested_Plugins();
$WPSEO_Suggested_Plugins->add_notifications();

Код WPSEO_Suggested_Plugins::add_notifications() Yoast 19.10

public function add_notifications() {
	$checker = $this->availability_checker;

	// Get all Yoast plugins that have dependencies.
	$plugins = $checker->get_plugins_with_dependencies();

	foreach ( $plugins as $plugin_name => $plugin ) {
		if ( ! $checker->dependencies_are_satisfied( $plugin ) ) {
			continue;
		}

		$notification = $this->get_yoast_seo_suggested_plugins_notification( $plugin_name, $plugin );

		if ( ! $checker->is_installed( $plugin ) ) {
			$this->notification_center->add_notification( $notification );

			continue;
		}

		$this->notification_center->remove_notification( $notification );
	}
}