Returning WP_Error objects in unexpected places
|Reported by:||filosofo||Owned by:||filosofo|
All of the functions listed below return WP_Error objects if something goes wrong. The problem is that in most of the many places where these functions appear throughout the WordPress codebase, whatever has called them is not expecting to get a WP_Error object.
So what happens is that you get a fatal error along the lines of "Fatal error: Cannot use object of type WP_Error as array in . . ." instead of the kind of helpful error handling WP_Error is supposed to provide.
I would like to use this ticket to create patches to address each of the areas where this occurs.
Functions that return WP_Error objects
(those marked with * have received the WP_Error object from elsewhere)