Make WordPress Core

Opened 17 years ago

Closed 17 years ago

#12707 closed defect (bug) (fixed)

term_description() shouldn't return error objects

Reported by: filosofo Owned by:
Priority: normal Milestone: 3.0
Component: Template Version: 3.0
Severity: normal Keywords: has-patch term_description commit
Cc: Focuses:

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().

Attachments (1)

term_description-error_handling.12707.diff​ (496 bytes ) - added by filosofo 17 years ago.

Download all attachments as: .zip

Change History (3)

#1 @scribu
17 years ago

  • Keywords commit added

Looks good.

#2 @ryan
17 years ago

  • Resolution → fixed
  • Status new → closed
Note: See TracTickets for help on using tickets.