WooCommerceIntegrationFrontend.php: argument to video_product_tabs can be null
-
When a product has no tabs the $tabs argument to video_product_tabs() is null in WooCommerceIntegrationFrontend.php and causes an exception in the array_multisort() call on line 28.
Warning: Invalid argument supplied for foreach() in /var/www/html/wp-content/plugins/woocommerce-html5-video/WooCommerceIntegrationFrontend.php on line 25 Warning: array_multisort(): Argument #3 is expected to be an array or a sort flag in /var/www/html/wp-content/plugins/woocommerce-html5-video/WooCommerceIntegrationFrontend.php on line 28 Warning: Invalid argument supplied for foreach() in /var/www/html/wp-content/plugins/woocommerce-html5-video/WooCommerceIntegrationFrontend.php on line 41
Adding the following to the top of the funtion mitigates the problem:
if ($tabs === null) { $tabs = []; }
- The topic ‘WooCommerceIntegrationFrontend.php: argument to video_product_tabs can be null’ is closed to new replies.