[wp-trac] [WordPress Trac] #22700: Walker_Category_Checklist should sometimes set the value as the term name

WordPress Trac noreply at wordpress.org
Mon Dec 3 19:45:58 UTC 2012


#22700: Walker_Category_Checklist should sometimes set the value as the term name
-----------------------------+--------------------------
 Reporter:  simonwheatley    |       Type:  defect (bug)
   Status:  new              |   Priority:  normal
Milestone:  Awaiting Review  |  Component:  General
  Version:  trunk            |   Severity:  normal
 Keywords:                   |
-----------------------------+--------------------------
 The `Walker_Category_Checklist` class has been partially adapted to work
 with taxonomies other than `category`, but it does not seem to cope with
 non-hierachical taxonomies.

 For non-hierachical taxonomies, the HTML form elements (checkboxes,
 radios, dropdowns, whatever) need to set the term **name** as the value,
 not the ID… otherwise WordPress will cast the ID to a string and create a
 new term with that string as a name.

 To see the problem:

 * Use `Walker_Category_Checklist` to create a checkbox in a metabox on the
 post edit screen for a non-hierarchical taxonomy
 * Add some terms to the taxonomy
 * Check the box for the taxonomy and update the post
 * Watch a new term appear with its name set to the ID of the term you
 checked

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/22700>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list