WC_Plugin_Updates::get_plugins_with_header()protectedWC 1.0

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

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

Хуки из метода

Возвращает

Массив. Array of plugins that contain the searched header.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_plugins_with_header( $header );
$header(строка) (обязательный)
Plugin header to search for.

Код WC_Plugin_Updates::get_plugins_with_header() 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 );
}