From 8f7da54cac0db0e608aac732364ef0e12d9a1ec8 Mon Sep 17 00:00:00 2001 From: Justin Sternberg Date: Wed, 26 Mar 2014 15:04:04 -0400 Subject: [PATCH] Resolve issue where we only get the first character of the label/value. Props @mustardBees. Closes #486 --- helpers/cmb_Meta_Box_types.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helpers/cmb_Meta_Box_types.php b/helpers/cmb_Meta_Box_types.php index 51cc6fa..3439c79 100644 --- a/helpers/cmb_Meta_Box_types.php +++ b/helpers/cmb_Meta_Box_types.php @@ -172,8 +172,8 @@ public function concat_options( $args = array(), $method = 'list_input' ) { foreach ( $options as $option_key => $option ) { // Check for the "old" way - $opt_label = isset( $option['name'] ) ? $option['name'] : $option; - $opt_value = isset( $option['value'] ) ? $option['value'] : $option_key; + $opt_label = is_array( $option ) && array_key_exists( 'name', $option ) ? $option['name'] : $option; + $opt_value = is_array( $option ) && array_key_exists( 'value', $option ) ? $option['value'] : $option_key; $selected = $value == $opt_value; if ( ! empty( $args ) ) {