Hello,
I’ve encountered an issue with the Woodmart theme. When uploading product images via the official WooCommerce mobile app, I’m getting the following error on the product page:
Warning: in_array() expects parameter 2 to be array, string given in /home/miashoes/mia-shoes.com/www/wp-content/themes/woodmart/inc/modules/parts-css-files/class-parts-css-files.php on line 432
The error seems to originate in the enqueue_inline_style() function. The problematic part of the code is:
Ploblem Line – if ( ! isset( $config[ $key ] ) || in_array( $key, $page_files, true ) || ( woodmart_is_combined_needed( ‘combined_css’ ) && ! $ignore_combined ) || isset( $GLOBALS[‘wd_page_css_ignore’] ) ) {
return;
}
It seems that the variable $page_files is not always an array, which causes in_array() to throw this error.
When I save the product via the standard WordPress editor (not the WooCommerce app), the error disappears. This makes me think it might be related to how the WooCommerce app saves product data.