[wp-trac] [WordPress Trac] #23109: Inconsistent returned value
WordPress Trac
noreply at wordpress.org
Thu Jan 3 23:44:19 UTC 2013
#23109: Inconsistent returned value
--------------------------+----------------------
Reporter: fp2x | Owner:
Type: defect (bug) | Status: closed
Priority: normal | Milestone:
Component: Taxonomy | Version: 3.5
Severity: normal | Resolution: invalid
Keywords: |
--------------------------+----------------------
Changes (by SergeyBiryukov):
* status: new => closed
* resolution: => invalid
* milestone: Awaiting Review =>
Comment:
> `get_cat_ID` doesn't take avantage of `_make_cat_compat`.
It doesn't need to. `_make_cat_compat()` just fills up some legacy
category fields: [[BR]]
http://core.trac.wordpress.org/browser/tags/3.5/wp-
includes/category.php#L301
It makes sense for `get_category_by_slug()`, which returns the full
object, but not for `get_cat_ID()`, which only returns the ID.
I can reproduce getting 0 when passing a slug rather than the name to
`get_cat_ID()`. But that's the expected result if there's no category by
that name. If the name actually matches the slug, `get_cat_ID()` returns
the proper ID. This behaviour is the same in 3.4 and 3.5.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/23109#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list