diff --git a/change_log.txt b/change_log.txt index 19b2550..3a4d1ed 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,5 +1,6 @@ = 1.9 = - Updated the plugin to support installing packages through Packagist. +- Fixed and issue where the value of fields stored as arrays is type casted to a string when displaying an entry in the terminal. = 1.8 = - Fixed a bug where the verify checksums command fails even when it should succeed. diff --git a/includes/class-gf-cli-entry.php b/includes/class-gf-cli-entry.php index 155d77b..0059c03 100644 --- a/includes/class-gf-cli-entry.php +++ b/includes/class-gf-cli-entry.php @@ -96,6 +96,10 @@ public function get( $args, $assoc_args ) { $value = $this->get_entry_value( $entry, $field_id, $form ); } + if ( is_array( $value ) ) { + $value = json_encode( $value ); + } + // Add the data gathered to the $rows array. $rows[] = array( 'ID' => $field_id, 'Field' => $label, 'Value' => (string) $value ); }