In the error log of my server i´m getting the following PHP Warning:
in_array() expects parameter 2 to be array, boolean given in " //..." on line 45.
In line 45 i have set a function that checks wether WooCommerce plug-in is active.
/**
* Construction function
*/
public function __construct() {
// Check if Woocomerce plugin is actived
if ( ! in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
return;
}
$this->new_duration = sober_get_option( 'product_newness' );
$this->parse_query();
$this->hooks();
}
Checking if it´s active with the if statement is necessary, is there anything i´m not seeing?
The error keeps popping up in my error log.
apply_filters()
return an array? – Markus Zeller Apr 25 '20 at 9:13in_array()
expects 2nd param as array. – Markus Zeller Apr 25 '20 at 9:16