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.
10 comments
Oliver
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
Melissa Fox-Austin
Thank you!
indianaG
Thanks Neil !!! ;-)
Blade
Cool :D
aurora
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.
Neil Gee
The change is not in your theme files it is in WordPress core /wp-includes/category-template.php
michi
Thanks a lot ! Saved my day :)
Jill
Thank you!!! Your fix fixed it ;)
Avinash Kabra
Thank you so much for the fix.
Brian
Life saver. Updated WordPress and it gave me this error. This fixed it. Thank you!