Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
API page: https://api.drupal.org/api/drupal/modules%21field%21field.module/functio...
Update documentation related to using custom formatters with field_view_field. This was difficult to find and may come up often when related to things like taxonomy.
If the custom formatter module is used something like the following must be used:
$display = array('type' => 'custom_formatters_my_formatter');
$output = field_view_field('node', $node, 'field_foo', $display);
Comments
Comment #1
Deciphered CreditAttribution: Deciphered commentedfield_view_field() is a great function, very useful.... however I'm not sure what you are asking or suggesting in this issue.
Do you want me to provide documentation somewhere, change how the module works somehow, or are you just sharing this function for others who might find it useful in their own PHP custom formatters?