WC_Plugin_Updates::get_plugins_with_header() protected WC 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 Plugin Updates::get plugins with header WC 5.0.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 );
}