[wp-trac] [WordPress Trac] #20679: Widget with mutliple select doesn't work

WordPress Trac wp-trac at lists.automattic.com
Tue May 15 18:07:36 UTC 2012


#20679: Widget with mutliple select doesn't work
--------------------------+----------------------
 Reporter:  topweb        |       Owner:
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  Widgets       |     Version:  3.3.2
 Severity:  normal        |  Resolution:  wontfix
 Keywords:  needs-patch   |
--------------------------+----------------------
Changes (by kurtpayne):

 * cc: kpayne@… (added)


Comment:

 Again, checkboxes is the way to go.  Just wanted to defend the core,
 though.  The behavior you're seeing is because you need two square
 brackets after a multiple select field name to tell php to treat the field
 as an array.

 {{{
 <select multiple="multiple" name="<?php echo
 $this->get_field_name('options'); ?>[]">
 }}}

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


More information about the wp-trac mailing list