Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add std ability to select type

the select type was missing the ability to set default options, so I
added it.
  • Loading branch information...
commit b347ebf0a3daa40e71fe934c36f6b1272eddd9a7 1 parent 40f5660
Justin Sternberg jtsternberg authored
Showing with 1 addition and 0 deletions.
  1. +1 −0  init.php
1  init.php
View
@@ -241,6 +241,7 @@ function show() {
echo '<textarea name="', $field['id'], '" id="', $field['id'], '" cols="60" rows="10" class="cmb_textarea_code">', '' !== $meta ? $meta : $field['std'], '</textarea>','<p class="cmb_metabox_description">', $field['desc'], '</p>';
break;
case 'select':
+ if( empty( $meta ) && !empty( $field['std'] ) ) $meta = $field['std'];
echo '<select name="', $field['id'], '" id="', $field['id'], '">';
foreach ($field['options'] as $option) {
echo '<option value="', $option['value'], '"', $meta == $option['value'] ? ' selected="selected"' : '', '>', $option['name'], '</option>';
Please sign in to comment.
Something went wrong with that request. Please try again.