WordPress.org

Make WordPress Core

#21888 closed defect (bug) (fixed)

Correct wp_count_terms() @return value

Reported by: SergeyBiryukov Owned by: nacin
Milestone: 3.5 Priority: normal
Severity: normal Version:
Component: Inline Docs Keywords: has-patch
Focuses: Cc:

Description

wp_count_terms() calls get_terms(), which returns a WP_Error object on failure:
http://core.trac.wordpress.org/browser/tags/3.4.2/wp-includes/taxonomy.php#L1163

Attachments (1)

21888.patch (579 bytes) - added by SergeyBiryukov 19 months ago.

Download all attachments as: .zip

Change History (2)

SergeyBiryukov19 months ago

comment:1 nacin19 months ago

  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from new to closed

In [21843]:

Update docs to reflect that wp_count_terms() can return WP_Error when the taxonomy does not exist. props SergeyBiryukov, fixes #21888.

Note: See TracTickets for help on using tickets.