I'm looking to preprocess a field.
The field type I'm wanting to preprocess is an entity reference field.
I need to know what view mode has been selected on the display settings for this field (see screenshot below).
This information is not made available in the $variables variable passed into preprocess_field.
So how can I get this load this information? I have tried looking for some Drupal-specific functions that would return these settings but haven't found anything that works.
Many thanks.