WC_Plugin_Updates::get_plugins_with_header()protectedWC 1.0

Get plugins that have a valid value for a specific header.

Method of the class: WC_Plugin_Updates{}

Hooks from the method

Return

Array. Array of plugins that contain the searched header.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_plugins_with_header( $header );
$header(string) (required)
Plugin header to search for.

WC_Plugin_Updates::get_plugins_with_header() code WC 8.7.0

protected function get_plugins_with_header( $header ) {
	$plugins = get_plugins();
	$matches = array();

	foreach ( $plugins as $file => $plugin ) {
		if ( ! empty( $plugin[ $header ] ) ) {
			$matches[ $file ] = $plugin;
		}
	}

	return apply_filters( 'woocommerce_get_plugins_with_header', $matches, $header, $plugins );
}