[wp-trac] [WordPress Trac] #16734: Allowing multiple selection when using wp_dropdown_categories
WordPress Trac
wp-trac at lists.automattic.com
Wed Mar 2 22:58:25 UTC 2011
#16734: Allowing multiple selection when using wp_dropdown_categories
---------------------------+-----------------------------
Reporter: grandslambert | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 3.1
Severity: normal | Keywords: has-patch
---------------------------+-----------------------------
I would like to be able to pass an argument to wp_dropdown_categories() to
allow the user to select more than one category using a CTRL-CLICK. I can
use a preg_replace to add the multiple tag to the html select tag, but I
cannot pass multiple selections in the "selected" argument.
I modified two files (wp-includes/category-template.php and wp-admin/css
/wp-admin.css) to add this option and will include patches for these
files. It adds a boolean argument for "multiple" to wp_dropdown_categories
and uses in_array to check if terms are listed in an array in the
"selected" argument, casting it as an array if it is not. I have tested
this patch to work in the latest trunk (3.1).
The change in the w-admin.css is so the multiple selection box is tall
enough to show the slider and more than one category.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/16734>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list