Allowing multiple selection when using wp_dropdown_categories
|Reported by:||grandslambert||Owned by:|
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.