Warning: array_map(): Argument #2 should be an array … /wp-includes/category-template.php on line 1158
Since upgrading to WordPress 4.4 I had some sites’ post archives display with the following error –
'Warning: array_map(): Argument #2 should be an array in /home/.../public_html/wp-includes/category-template.php on line 1158'
This seems to be an issue with WordPress’ function get_the terms and the argument $items referenced as an array, and will be addressed in the next update – 4.4.1.
In the meantime you can add the patch yourself to the category-template.php in the wp-includes directory replacing the get_the_terms function.
I tried this patch as I was having issues retrieving a custom taxonomy, after applying tis patch it appears to mess around with the standard post categories, they disappeared form the posts admin screen and the frontend (but were still there). Reverting and they came back again
Thank you!
Thanks Neil !!! ;-)
Cool :D
so i don’t have a category-template.php, any ideas where i should put this? i did not notice any similar coding in my css stylesheet which was my guess.
The change is not in your theme files it is in WordPress core /wp-includes/category-template.php
Thanks a lot ! Saved my day :)
Thank you!!! Your fix fixed it ;)
Thank you so much for the fix.
Life saver. Updated WordPress and it gave me this error. This fixed it. Thank you!