Simplified logic for better readability.

This commit is contained in:
vedanshujain 2020-05-02 00:30:25 +05:30
parent f4e169f21e
commit 62ef169940
1 changed files with 1 additions and 2 deletions

View File

@ -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();
}