[wp-trac] [WordPress Trac] #12707: term_description() shouldn't return error objects
WordPress Trac
wp-trac at lists.automattic.com
Thu Mar 25 16:21:15 UTC 2010
#12707: term_description() shouldn't return error objects
--------------------------+-------------------------------------------------
Reporter: filosofo | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 3.0
Component: Template | Version: 3.0
Severity: normal | Keywords: has-patch term_description
--------------------------+-------------------------------------------------
`term_description()` and its wrappers like `category_description()` are
meant to be used in templates, so they shouldn't return `WP_Error`
objects.
However, if you call `term_description()` for a non-existent term you get
a fatal error as PHP attempts to treat the `WP_Error` object as a string.
Patch instead returns an empty string when an error bubbles up to
`term_description()`.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/12707>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list