I maintain Custom Submit Messages module that uses a theme function to change the status messages that D7 displays in certain contexts.

The module works fine except when the Omega theme is used. When Omega is running, it also uses a theme function to change Drupal's status messages, and the function that my module defines is not run.

What determines the hierarchy for theme functions in Drupal 7? Why does that Omega's theme function run, rather than the theme function defined by my module? Is there any way to change this hierarchy?

  • I don't have time to test but would it be as simple as function MYMODULE_theme_registry_alter(&$registry) { $registry['status_messages']['function'] = 'MYMODULE_foo'; }, and then a theme function in your module called MYMODULE_foo with $vars as the single param?
    – Clive
    Commented Nov 25, 2015 at 22:14


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.