Dynamically update views field labels I have been searching for a while, but cannot find an answer to this. How can I get access to the field name in a view (the label used in the content type)?

I am trying to create an anchor navigation through a view that only displays a link to a field if it has content. I have a custom content type with a number of long text fields and a view, and I would like to rewrite the content of the field with its field label but I cannot figure out how to access the field label. I would like to do it programatically in case the user asks to change the name of a field.
In Drupal 7 the _field_info_field_cache() function retrieves the FieldInfo which gives you access to various field data.

function get_field_label($entity, $bundle, $field) {
  $field_info = _field_info_field_cache();
  $fields = $field_info-&gt;getBundleInstances($entity, $bundle);
  return isset($fields[$field]['label']) ? $fields[$field]['label'] : FALSE;
}

//Retrieve the tags label from an article node in a D7 Standard install
get_field_label ('node','article','field_tags');