Skip to content

Commit

Permalink
Added support for setting a select element with options when creating…
Browse files Browse the repository at this point in the history
… a metabox
  • Loading branch information
JeffreyWay committed Oct 7, 2011
1 parent 187d8e0 commit a6181e5
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions readme.md
Expand Up @@ -56,10 +56,8 @@ However, if you require a select box, you need to pass an array, with the first
key equaling the type of input to create ('select' element), and the second key
being an array of choices. For example:

$snippet->add_meta_box(
'Favorite Food' =>
array(
'select', // type of form field
array('pizza', 'tacos', 'sandwiches') // list of options
)
);
$snippet->add_meta_box( 'Personal Info', array(
'Name' => 'text',
'Bio' => 'textarea'
'Favorite Food' => array( 'select', array('pizza', 'tacos') )
);

0 comments on commit a6181e5

Please sign in to comment.