Permalink
Browse files

Added support for setting a select element with options when creating…

… a metabox
  • Loading branch information...
JeffreyWay committed Oct 7, 2011
1 parent 187d8e0 commit a6181e5193318bf9d2e4c74df6dbdc2556d02d1b
Showing with 5 additions and 7 deletions.
  1. +5 −7 readme.md
View
@@ -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.