WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have multiple values I need to be able to punch into a meta-box on the post edit screen.

EX: I am working with set-list information for concerts.

  1. Song 1
  2. Song 2
  3. Song 3


I am always looking for efficiency in my code, here's the point:

Do I just create a brand new id (i.e. song_1, song_2) for every song. Or is there a more condensed way to go about this. Here's a sample of how I would do it as of right now... which would seem like a lot of unncessary code, but then again I am not certain.


$meta_box['post'] = array(

// default values, will change to more descriptive values later

    'id' => 'post-format-meta',  
    'title' => 'Additional Post Format Meta',    
    'context' => 'normal',           
    'priority' => 'high',
    'fields' => array(
            'name' => 'Song 1',
            'desc' => 'Setlist Song 1',
            'id' => 'song_1',
            'type' => 'text',
            'default' => ''
            'name' => 'Song 2',
            'desc' => 'Setlist Song 2',
            'id' => 'song_2',
            'type' => 'text',
            'default' => ''

// then additional songs 

add_action('admin_menu', 'plib_add_box');
share|improve this question
up vote 1 down vote accepted

I believe that your best option would be to create a single field and save all values in an array, something like this: Create more Meta Boxes as needed.

share|improve this answer

You could look at adding a custom select meta box for the songs instead of just having multiple text boxes.


You can then code it up to be a select box with each option in.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.