Simplified logic for better readability.
This commit is contained in:
parent
f4e169f21e
commit
62ef169940
|
@ -1156,8 +1156,7 @@ class WC_Helper {
|
|||
* WC Headers will not be present if `wc_enable_wc_plugin_headers` hook was added after a `get_plugins` call -- for example when WC is activated/updated.
|
||||
* Also, get_plugins call is expensive so we should clear this cache very conservatively.
|
||||
*/
|
||||
$first_plugin = array_keys( $plugins )[0];
|
||||
if ( $first_plugin && ! array_key_exists( 'Woo', $plugins[ $first_plugin ] ) ) {
|
||||
if ( ! empty( $plugins ) && ! array_key_exists( 'Woo', current( $plugins ) ) ) {
|
||||
wp_clean_plugins_cache( false );
|
||||
$plugins = get_plugins();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue