Why is “plugins_loaded” not called/fired?

I am trying call load_plugin_textdomain once the plugins are loaded, however this does not happen. I do have a plugin activated, so shouldn’t this fire?

add_action("plugins_loaded", "test_override");

function init_localization()
{
    echo "init_localization<br>";
    load_plugin_textdomain
    (
        TEXT_DOMAIN, 
        false, 
        LANGUAGE_DIR
    );
}

function test_override()
{
    echo "text_override<br>";
}

In another context, when calling add_action("init", "init_custom_post_types"), it works fine.

It may be of interest to know that I am working on a custom theme.

Thanks if you can provide any guidance, or ask if you need to know anything that could help you help me.

1
1

Have a look at the wp-settings.php file. You’ll see that the plugins_loaded action is triggered before the theme is loaded. The first action available for themes to hook into is the after_setup_theme action.

Leave a Comment