Automattic\WooCommerce\Blueprint\Importers

ImportInstallPlugin::get_installed_plugins_pathsprotectedWC 1.0

Retrieves an array of installed plugins and their paths.

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

Хуков нет.

Возвращает

Массив. Array of installed plugins and their paths.

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

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

Код ImportInstallPlugin::get_installed_plugins_paths() WC 10.0.2

protected function get_installed_plugins_paths() {
	if ( ! function_exists( 'get_plugins' ) ) {
		require_once ABSPATH . 'wp-admin/includes/plugin.php';
	}

	$plugins           = get_plugins();
	$installed_plugins = array();

	foreach ( $plugins as $path => $plugin ) {
		$path_parts                 = explode( '/', $path );
		$slug                       = $path_parts[0];
		$installed_plugins[ $slug ] = $path;
	}

	return $installed_plugins;
}