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

WPSEO_Addon_Manager::convert_subscription_to_plugin() protected Yoast 1.0

Converts a subscription to plugin based format.

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

Хуков нет.

Возвращает

stdClass. The converted subscription.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->convert_subscription_to_plugin( $subscription );
$subscription(stdClass) (обязательный)
The subscription to convert.

Код WPSEO_Addon_Manager::convert_subscription_to_plugin() Yoast 16.2

<?php
protected function convert_subscription_to_plugin( $subscription ) {
	// We need to replace h2's and h3's with h4's because the styling expects that.
	$changelog = str_replace( '</h2', '</h4', str_replace( '<h2', '<h4', $subscription->product->changelog ) );
	$changelog = str_replace( '</h3', '</h4', str_replace( '<h3', '<h4', $changelog ) );

	return (object) [
		'new_version'      => $subscription->product->version,
		'name'             => $subscription->product->name,
		'slug'             => $subscription->product->slug,
		'url'              => $subscription->product->store_url,
		'last_update'      => $subscription->product->last_updated,
		'homepage'         => $subscription->product->store_url,
		'download_link'    => $subscription->product->download,
		'package'          => $subscription->product->download,
		'sections'         => [
			'changelog' => $changelog,
			'support'   => $this->get_support_section(),
		],
		'icons'            => [
			'2x' => $this->get_icon( $subscription->product->slug ),
		],
		'update_supported' => true,
		'banners'          => $this->get_banners( $subscription->product->slug ),
		'tested'           => YOAST_SEO_WP_TESTED,
		'requires'         => YOAST_SEO_WP_REQUIRED,
		'requires_php'     => YOAST_SEO_PHP_REQUIRED,
	];
}