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.
Token hooks -- hook_token_info(), hook_tokens() etc -- can be in a MODULE.token.inc file.
This removes the need to have a "if (module_exists('token'))" wrapped around the function declarations.
Comments
Comment #1
hansfn CreditAttribution: hansfn commentedSure, that is a good idea, but maybe it should just wait for #2072415: restore use of VBO, but as an operation plugin? However, if it helps you in your work there, I can make the change now.
Comment #3
hansfn CreditAttribution: hansfn commentedI finally moved the hooks. I also realized that I never needed the "if (module_exists('token'))" since these hooks are defined by Drupal core. Anyway, thanks for the suggestion.