I'd like to implement template_preprocess_field in a module for organizational purposes.

How can I do this?


Reference: https://api.drupal.org/api/drupal/core%21includes%21theme.inc/function/template_preprocess_field/8.2.x


Hook functions are named like so: MODULENAME_hook.

In your case that's:

function MODULENAME_preprocess_field(&$variables) {

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.