[wp-trac] [WordPress Trac] #16101: Numeric term fields are strings
WordPress Trac
noreply at wordpress.org
Tue Feb 12 23:44:35 UTC 2013
#16101: Numeric term fields are strings
------------------------------------+-----------------------------
Reporter: foofy | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future Release
Component: Taxonomy | Version:
Severity: normal | Resolution:
Keywords: has-patch dev-feedback |
------------------------------------+-----------------------------
Changes (by iandunn):
* cc: ian_dunn@… (added)
* keywords: has-patch dev-feedback => has-patch dev-feedback
Comment:
This just bit me in the ass, because I took the term_id from get_terms()
and passed it to get_term_link() as $term. get_term_link() assumed that
$term was a slug because it failed is_int(), and since there's no term
named "237", it returned a WP_Error().
It seems to me like casting the values to int in get_term*() is the proper
fix, even if it requires patching/testing XML-RPC code. If there's a
consensus behind that approach, I'll try to find time to write and test a
new patch in the next couple weeks.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/16101#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list