WC_Install::associate_plugin_file()private staticWC 1.0

Get slug from path and associate it with the path.

{} It's a method of the class: WC_Install{}

No Hooks.


null. Nothing.


$result = WC_Install::associate_plugin_file( $plugins, $key );
$plugins(array) (required)
Associative array of plugin files to paths.
$key(string) (required)
Plugin relative path. Example: woocommerce/woocommerce.php.

Code of WC_Install::associate_plugin_file() WC 6.7.0

private static function associate_plugin_file( $plugins, $key ) {
	$path                 = explode( '/', $key );
	$filename             = end( $path );
	$plugins[ $filename ] = $key;
	return $plugins;