WPSEO_Admin_Utils::get_install_url()public staticYoast 1.0

Gets the install URL for the passed plugin slug.

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

Хуков нет.

Возвращает

Строку. The install URL. Empty string if the current user doesn't have the proper capabilities.

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

$result = WPSEO_Admin_Utils::get_install_url( $slug );
$slug(строка) (обязательный)
The slug to create an install link for.

Код WPSEO_Admin_Utils::get_install_url() Yoast 22.4

public static function get_install_url( $slug ) {
	if ( ! current_user_can( 'install_plugins' ) ) {
		return '';
	}

	return wp_nonce_url(
		self_admin_url( 'update.php?action=install-plugin&plugin=' . dirname( $slug ) ),
		'install-plugin_' . dirname( $slug )
	);
}