WC_Helper::get_local_plugins()public staticWC 1.0

Get locally installed plugins

Method of the class: WC_Helper{}

No Hooks.

Return

Array.

Usage

$result = WC_Helper::get_local_plugins();

WC_Helper::get_local_plugins() code WC 8.9.0

public static function get_local_plugins() {
	if ( ! function_exists( 'get_plugins' ) ) {
		require_once ABSPATH . 'wp-admin/includes/plugin.php';
	}
	$plugins = get_plugins();

	$output_plugins = array();
	foreach ( $plugins as $filename => $data ) {
		array_push(
			$output_plugins,
			array(
				'_filename' => $filename,
				'_type'     => 'plugin',
				'slug'      => dirname( $filename ),
				'Version'   => $data['Version'],
			)
		);
	}

	return $output_plugins;
}