[wp-trac] [WordPress Trac] #25852: Saving term broken. If no term parent is set - sets to term ID 1.
WordPress Trac
noreply at wordpress.org
Wed Nov 6 21:27:54 UTC 2013
#25852: Saving term broken. If no term parent is set - sets to term ID 1.
--------------------------+-----------------------------
Reporter: mattheu | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version:
Severity: normal | Keywords: has-patch
--------------------------+-----------------------------
This was introduced by the fix for ticket #17646
When saving a term with no parent selected - the parent is saved as term
`1`. It should be set to `0`. For non-category terms - this causes them to
dissapear from the admin.
From category-template.php line 346 - The term parent select field uses
`-1` for `none` - and this is now cast to `1` by the `sanitize_term_field`
function - which saves the term parent as 1.
I've added a patch that sets any negative values to 0.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/25852>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list