WordPress.org

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Plugin API/Action Reference/load-themes.php

Description

The action load-themes.php is triggered when the theme option page is shown. It executes only when the theme that contains the action (in function.php) is selected.

You can use it to execute something when your theme is activated or deactivated.

Usage

 <?php add_action('load-themes.php'$function_to_add); ?> 

Example

function init_theme() {
  if ( isset( $_GET['activated'] ) ) { // Test if theme is activated
    // What to do when theme is active
  }
}
add_action( 'load-themes.php', 'init_theme' );

See also

This page is marked as incomplete. You can help Codex by expanding it.