Trying to find an issue with my theme that is not related with this question, I've started the debugger and enabled a breakpoint to the first line of a function hooked to after_setup_theme.
Here I've realized that the function is called three times, before the page is rendered.
Is that normal? Isn't this action supposed to be called only one time?
Here's an excerpt of the functions.php (after_setup_theme is the only hook in functions.php):
function get_theme_text_domain() { $theme = wp_get_theme(); return $theme->get('TextDomain'); } //This is the function that is called 3 times when opening any page of the site function tamtando_theme_setup() { load_textdomain(get_theme_text_domain(), get_template_directory() . '/languages'); //[...] } add_action('after_setup_theme', 'tamtando_theme_setup'); To clarify, checking the value of $wp_filter['after_setup_theme'], I've found 2 hooks: one is from my theme, the other, from the "Event Organiser" plugin, calling a different function (I wonder why the developer is using this hook, but this doesn't relate to this issue).
after_setup_theme- because someone complained that their theme set up symlinks and they weren't able to over-ride the value assigned to the constant from their theme. I maintain that theme's shouldn't be doing that (a plug-ins job) but anyhow - that's what that function is doing :).