[wp-trac] [WordPress Trac] #25429: `get_the_category_by_ID` triggers PHP notice on non-existent category

WordPress Trac noreply at wordpress.org
Thu Oct 3 10:46:46 UTC 2013


#25429: `get_the_category_by_ID` triggers PHP notice on non-existent category
------------------------------------+------------------
 Reporter:  ericmann                |       Owner:
     Type:  defect (bug)            |      Status:  new
 Priority:  normal                  |   Milestone:  3.7
Component:  Taxonomy                |     Version:  2.3
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |
------------------------------------+------------------
Changes (by johnbillion):

 * keywords:  has-patch => has-patch dev-feedback


Comment:

 Note that `get_tag()` just returns the value of `get_term()`, so it
 returns `null` if the tag doesn't exist. Should we match `get_tag()` for
 consistency, or should we return a `wp_error` as per Sergey's patch?

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25429#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list