How Theme Functions Are Created
Drupal core and modules usually define theme functions, but they can be defined by themes as well.
hook_theme() implementations are where all the juicy information about most generic theme functions resides, including what parameters these functions accept. Theme hooks are covered in detail in the “Theme Hook Suggestions” section later in this chapter, but Listing 15–11 shows what a simple
hook_theme() implementation looks like.
hook_theme() let Drupal know about theme hooks. Once Drupal is aware, it will search for a theme function called
theme_my_theme_hook() in this case, which might look like the code in Listing 15–12.