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