Error when single category chosen
-
When a single category is chosen, an error appears on the page
Warning: in_array() expects parameter 2 to be array, string given in /home/barefruit/hvg-fabrics.barefruit.com.au/wp-content/plugins/mixitup-portfolio-widget/mixitup-portfolio-widget.php on line 142
Warning: in_array() expects parameter 2 to be array, string given in /home/barefruit/hvg-fabrics.barefruit.com.au/wp-content/plugins/mixitup-portfolio-widget/mixitup-portfolio-widget.php on line 202
Also when the widget is opened in back-end, the chosen category is no longer preselected.
Both can be fixed by adding the following code to mixitup-portfolio-widget.php:
// cast $category_ids[0] to array if just a single category chosen
if(!is_array($category_ids[0])) $category_ids[0] = array($category_ids[0]);Insert it twice, once on line #138 to fix the front-end error, and once on line #348 to fix the back-end.
Can the author include this fix in the next version? Thanks
- The topic ‘Error when single category chosen’ is closed to new replies.