1

I have a theme called hasta, and created a sub theme to customize certain aspects of it. One of the things I wanted to do is change the behavior of one of the hooks, hook_element_info_alter. The hasta theme defines this as hasta_element_info_alter in template.php.

My sub theme is called hasta_sub, and in that template.php I have overwritten this hook as hasta_sub_element_info_alter.

I put some debug statements, and I can see that my new hook hasta_sub_element_info_alter is being called, but the parent theme hook, hasta_element_info_alter, is still being called as well right before this.

Drupal helps says:

Theme functions are called through theme('[hook]', $var, ...). When a sub-theme overrides a theme function, no other version of that theme function is called.

So according to this only the sub theme version of that hook should be getting called. Can anyone please tell me what I am doing wrong?

Thanks!

1 Answer 1

1

Yes theme functions when overridden stay overridden in the sub-theme, but this is not a theme function, but rather a hook function used in a theme.

So hook_element_info_alter() whenever it is implemented will run.

1
  • Thanks I guess I was confused as to what is a theme function and what is not. I just wanted to make sure I wasn't doing something wrong. Turns out I was just confused. May 26, 2016 at 21:33

Your Answer

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

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