Ready to get started?Download WordPress


after_setup_theme not running after theme setup (2 posts)

  1. Leo Blanchette
    Posted 12 months ago #

    In a plugin I've done an add_action( 'after_setup_theme' , 'some_funct' ); and then the plugin calls a function named in the theme's functions.php file.

    It should work! It came in after "theme setup"! Yet its saying undefined function!!! I'm living in the twighlight zone.

    Is there any instances or reasons after_setup_theme would disobey the idea of loading after theme setup?

  2. bcworkz
    Posted 11 months ago #

    Yes but not normally encountered, either WP is installing or a MU blog is being activated. See for yourself near the end of wp-settings.php.

    You could try 'init' or 'wp-loaded' though it should not make any difference. Something very queer is going on if it did. If not, you may have done something silly like nested function definitions, or even editing the wrong functions.php file. You can imagine how I know about these errors, I'm sure there's others I'll eventually discover.


You must log in to post.

About this Topic