Warning: in_array() expects parameter 2 to be array, null given in
-
Hello,
i have noticed that i have a problem with a site. Under every page it shows a warning:
Warning: in_array() expects parameter 2 to be array, null given in /home/users/akselp01/public_html/domains/dent-guard.pl/public_html/wp-content/themes/oceanwp/functions.php on line 972In functions it is:
}
function my_custom_available_payment_gateways( $gateways ) {
$chosen_shipping_rates = ( isset( WC()->session ) ) ? WC()->session->get( ‘chosen_shipping_methods’ ) : array();if ( in_array( ‘flat_rate:1’, $chosen_shipping_rates ) ) :
unset( $gateways[‘cod’] );elseif ( in_array( ‘flat_rate:2’, $chosen_shipping_rates ) ) :
unset( $gateways[‘bacs’] );elseif ( in_array( ‘flat_rate:3’, $chosen_shipping_rates ) ) :
unset( $gateways[‘cod’] );elseif ( in_array( ‘flat_rate:4’, $chosen_shipping_rates ) ) :
unset( $gateways[‘bacs’] );endif;
return $gateways;
}What i can do to fix it?
Thanks!
The page I need help with: [log in to see the link]
The topic ‘Warning: in_array() expects parameter 2 to be array, null given in’ is closed to new replies.
