files ) ) { return array(); } if ( $this->smush_is_json( $files ) ) { $files = json_decode( $files ); } elseif ( 'post_image' === $field->get_input_type() ) { $file_bits = explode( '|:|', $files ); $files = array( $file_bits[0] ); } else { $files = array( $files ); } return $files; } /** * Check entry files in JSON format. * * @since 3.9.10 * * @param String $string File string. * * @return bool */ public function smush_is_json( $string ) { // Duplicate contents of GFCommon::is_json() here to supports versions of GF older than GF 2.5. if ( is_string( $string ) && in_array( substr( $string, 0, 1 ), array( '{', '[' ) ) && is_array( json_decode( $string, ARRAY_A ) ) ) { return true; } return false; } }