Automattic\WooCommerce\Admin

PluginsHelper::get_installed_plugins_paths()public staticWC 1.0

Get an array of installed plugins with their file paths as a key value pair.

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

Хуков нет.

Возвращает

Массив.

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

$result = PluginsHelper::get_installed_plugins_paths();

Код PluginsHelper::get_installed_plugins_paths() WC 8.7.0

public static function get_installed_plugins_paths() {
	$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;
}