WPSEO_Admin_Utils::get_install_link()public staticYoast 1.0

Creates a link if the passed plugin is deemend a directly-installable plugin.

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

Хуков нет.

Возвращает

Строку. The link to the plugin install. Returns the title if the plugin is deemed a Premium product.

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

$result = WPSEO_Admin_Utils::get_install_link( $plugin );
$plugin(массив) (обязательный)
The plugin to create the link for.

Код WPSEO_Admin_Utils::get_install_link() Yoast 22.4

public static function get_install_link( $plugin ) {
	$install_url = self::get_install_url( $plugin['slug'] );

	if ( $install_url === '' || ( isset( $plugin['premium'] ) && $plugin['premium'] === true ) ) {
		return $plugin['title'];
	}

	return sprintf(
		'<a href="%s">%s</a>',
		$install_url,
		$plugin['title']
	);
}