I’ve “inherited” the development of an old theme that I’m now bringing up to speed for WP 3.9.
The theme code comes with a
functions.php that has a function theme_name_setup() that hooks into after_theme_setup. So far, so good.
However, it appears that just about everything under the sun has been thrown into the theme_name_setup() function, and all the other theme files for admin pages, templating functions, styling functions, custom headers, widgets, etc — all this is called (via
require_once) from within this theme_name_setup(), and is thus all loaded, willy-nilly, on the after_theme_setup hook.
I’ve looked at other themes (the default 2012, -13, -14 and underscores) which have a much cleaner theme_setup() function, and I know enough to know that hooking absolutely everything — functions within functions — on the same hook is a train wreck waiting to happen (though the theme does seem to operate alright this way for now). I have the examples of the default themes to go by, but what I want to know (and can't seem to find via almighty Google) is specifically:
Beyond add_theme_support(), textdomain/localization considerations, register_nav_menus(), and thumbnail support, what if anything, should be specifically included into the theme_name_setup() function, hooked as described above? (And, by extension, everything else should be defined/hooked somewhere else.)