WordPress.org

Ready to get started?Download WordPress

Ideas

Function calling when theme is activating/deactivating

  1. czepol
    Member

    12345

    Now, when theme developers want to call function after activation or deactivation of theme, they must using not the best solutions like this:

    global $pagenow;
    if ( is_admin() && $pagenow == “themes.php” && isset($_GET['activated']) ) {
    }

    I propose to create a function similar to register_activation_hook and register_deactivation_hook, but for themes.

    Posted: 3 years ago #
  2. Justin Tadlock
    Member

    12345

    Theme authors should be hooking to load-themes.php, really.

    As for the idea, I've been wanting this forever.

    Related:
    http://core.trac.wordpress.org/ticket/14849

    Posted: 3 years ago #
  3. scibuff
    Member

    How about using the 'after_setup_theme' hook?

    Posted: 3 years ago #
  4. Justin Tadlock
    Member

    12345

    How about using the 'after_setup_theme' hook?

    It fires on every page view, not just when the theme is activated/deactivated. So, it won't work.

    Posted: 3 years ago #

RSS feed for this topic

Reply

You must log in to post.

  • Rating

    12345
    5 Votes
  • Status

    Good idea! We're working on it