What reason might we have to do such a thing? It seems it's helpful in providing a custom theme.

hook_init is invoked after hook_custom_theme, which means we don't have an active space when the theme is determined. If in our site we put a call to spaces_init() in our implementation of hook_custom_theme, then we can use the active space to set the theme.

Currently, that causes the code in spaces_init() to run twice, because it's executed when hook_init is invoked. It's probably a good idea to let it run only once (unless you've got a reason to force it to reinitialize). Sound good?

Comments

michaek’s picture