WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Получай пассивный доход от сайта с помощью браузерных PUSH уведомлений
функция не описана

WPSEO_Upgrade::upgrade_49() private Yoast 1.0

Removes the 'wpseo-dismiss-about' notice for every user that still has it.

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

Хуков нет.

Возвращает

null. Ничего.

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

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

Код WPSEO_Upgrade::upgrade_49() Yoast 16.2

<?php
private function upgrade_49() {
	global $wpdb;

	/*
	 * Using a filter to remove the notification for the current logged in user. The notification center is
	 * initializing the notifications before the upgrade routine has been executedd and is saving the stored
	 * notifications on shutdown. This causes the returning notification. By adding this filter the shutdown
	 * routine on the notification center will remove the notification.
	 */
	add_filter( 'yoast_notifications_before_storage', [ $this, 'remove_about_notice' ] );

	$meta_key = $wpdb->get_blog_prefix() . Yoast_Notification_Center::STORAGE_KEY;

	$usermetas = $wpdb->get_results(
		$wpdb->prepare(
			'
			SELECT user_id, meta_value
			FROM ' . $wpdb->usermeta . '
			WHERE meta_key = %s AND meta_value LIKE %s
			',
			$meta_key,
			'%wpseo-dismiss-about%'
		),
		ARRAY_A
	);

	if ( empty( $usermetas ) ) {
		return;
	}

	foreach ( $usermetas as $usermeta ) {
		$notifications = maybe_unserialize( $usermeta['meta_value'] );

		foreach ( $notifications as $notification_key => $notification ) {
			if ( ! empty( $notification['options']['id'] ) && $notification['options']['id'] === 'wpseo-dismiss-about' ) {
				unset( $notifications[ $notification_key ] );
			}
		}

		update_user_option( $usermeta['user_id'], Yoast_Notification_Center::STORAGE_KEY, array_values( $notifications ) );
	}
}