How to get alter value of a views field programmatically I've developed a Views field plugin that extracts the value from another field in the view in order to apply some math. The plugin works great at getting the original value of the field. However, I would like users to be able to get the rewritten value of a given field. I've been searching around, but can't seem to find any documentation on this.

With the following code I can get the value of another field:

public function getValue(ResultRow $values, $field = NULL) {
  parent::getValue($values, $field);

  $field = $this-&gt;options['data_field'];
  $value = $values-&gt;_entity-&gt;get($field)-&gt;value;

  // I have some logic here that's not necessary for this question.

  return $value;
}


What would I need to do within the above function to get the value of $field if $field had been rewritten via someone checking the "Override the output of this field with custom text" checkbox?
This is how I went about getting the "alter" value for my project:

if ($this-&gt;displayHandler-&gt;getHandler('field', $field)-&gt;options['alter']['alter_text'] == 1) {
  $value = $this-&gt;displayHandler-&gt;getHandler('field', $field)-&gt;options['alter']['text'];
}
else {
  $value = $values-&gt;_entity-&gt;get($field)-&gt;value;
}