[wp-trac] [WordPress Trac] #16734: Allowing multiple selection when using wp_dropdown_* functions

WordPress Trac noreply at wordpress.org
Fri Jul 4 17:43:52 UTC 2014


#16734: Allowing multiple selection when using wp_dropdown_* functions
------------------------------------+------------------
 Reporter:  grandslambert           |       Owner:
     Type:  enhancement             |      Status:  new
 Priority:  normal                  |   Milestone:  4.0
Component:  Taxonomy                |     Version:  3.1
 Severity:  normal                  |  Resolution:
 Keywords:  needs-docs needs-patch  |     Focuses:
------------------------------------+------------------

Comment (by prionkor):

 I was wondering if a array of key values pair could be passed which later
 becomes attribute value pair. We could introduce a new `attribute` key.

 For example

 {{{
 $args = array(
         'orderby'            => 'ID',
         'order'              => 'ASC',
         'show_count'         => 0,
         'hide_empty'         => 1,
         'child_of'           => 0,
         'exclude'            => '',
         'echo'               => 1,
         'selected'           => 0,
         'hierarchical'       => 0,
         'attributes' => array(
                               'multiple' => 'multiple',
                               'data-name' => 'datavalue1'
                               'data-name2' => 'datavalue2'
                         )
 );


 wp_dropdown_categories($args);

 }}}

 This would be helpful if we want to pass custom attributes like `data-`.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/16734#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list