kenpeter
kenpeter

Reputation: 8304

Drupal 7: cannot override in template.php

I try to override theme_menu_tree in drupal 7.

My function (shown below) is very simple, but it seems drupal skips it, even put a "die" there. I have clear the cache afterward, but it is no use.

Has anyone successfully override a function in template.php?

function unitheme_menu_tree($variables) {
    die("die!");
}

Upvotes: 1

Views: 644

Answers (1)

Cristobal Wetzig
Cristobal Wetzig

Reputation: 381

Just a friendly tip, you should pass the variable by reference with the & operator, the menu tree is a rather costly loop.

function unitheme_menu_tree(&$variables) {
}

Upvotes: 1

Related Questions