\hook_preprocess
function
Preprocess theme variables for templates.

Preprocess theme variables for templates.

This hook allows modules to preprocess theme variables for theme templates. It is called for all theme hooks implemented as templates, but not for theme hooks implemented as functions. hook_preprocess_HOOK() can be used to preprocess variables for a specific theme hook, whether implemented as a template or function.

For more detailed information, see theme().

Comments

nabajit’s picture

Why my theme_preprocess hook getting called many times on each page load?

jncruces’s picture

Do you have a module and a theme with the same machine name? modules/mysite themes/mysite?

fmr’s picture

This hook is called many times, but each time with a different value in the $hook argument.

If you use the "devel" module, try to stick a dpm($hook, "hook"); in your mytheme_preprocess function and see what happens.