%s'; $count = 0; foreach ( $field['options'] as $placeholder => $label ) { $html[] = sprintf( $input, $field['field_name'], isset( $meta[ $count ] ) ? esc_attr( $meta[ $count ] ) : '', $placeholder, $label ); $count ++; } return implode( ' ', $html ); } /** * Format value for the helper functions. * * @param array $field Field parameter * @param string|array $value The field meta value * @return string */ public static function format_value( $field, $value ) { $output = ''; foreach ( $field['options'] as $label ) { $output .= ""; } $output .= ''; if ( ! $field['clone'] ) { $output .= self::format_single_value( $field, $value ); } else { foreach ( $value as $subvalue ) { $output .= self::format_single_value( $field, $subvalue ); } } $output .= '
$label
'; return $output; } /** * Format a single value for the helper functions. * * @param array $field Field parameter * @param array $value The value * @return string */ public static function format_single_value( $field, $value ) { $output = ''; foreach ( $value as $subvalue ) { $output .= "$subvalue"; } $output .= ''; return $output; } }