jaredatch/Custom-Metaboxes-and-Fields-for-WordPress — Issue #37: Allow custom fields to save multiple values?
Author: randyhoyt
Created: 2011-11-03 22:20:00+00:00
State: open

The library has one built-in field that allows multiple values to be saved, the `multicheck`. It would be cool if custom field types could take advantage of that. It only requires a couple of tweaks to the current code (basically extending all the places the code checks if the field type is `multicheck` to check for a `multiple` attribute also). I have made these modifications and built a custom field on top of it, and it seems to be working well.

Does this seem like a useful addition?

## Example

![Screenshot](http://randyhoyt.com/wp-content/blogs.dir/2/files/select_store_multiple.jpg)

I'm building a site for a chain of retail stores with many locations. They have a section on their site for colleges: a site visitor can visit a page for their particular college that shows which of their stores carry merchandise with their school's branded merchandise. I have a post type for stores, and I have a post type for colleges. I create a custom field type with multiple dropdowns so that an indefinite number of stores can be selected from multiple dropdowns.