function drush_hide_empty_fields

8.0.x drush_hide_empty_fields($input, $fields)
6.x drush_hide_empty_fields($input, $fields)
7.x drush_hide_empty_fields($input, $fields)
master drush_hide_empty_fields($input, $fields)

Hide any fields that are empty

Related topics

1 call to drush_hide_empty_fields()
drush_rows_of_key_value_to_array_table in includes/
Convert an array of data rows, where each row contains an associative array of key : value pairs, into a table suitable for processing by drush_print_table. The provided $header determines the order that the items will appear in the output. Only data…


includes/, line 494


function drush_hide_empty_fields($input, $fields) {
  $has_data = array();
  foreach ($input as $key => $data) {
    foreach ($fields as $field => $label) {
      if (isset($data[$field]) && !empty($data[$field])) {
        $has_data[$field] = TRUE;
  foreach ($fields as $field => $label) {
    if (!isset($has_data[$field])) {
  return $fields;