WordPress.org

Ready to get started?Download WordPress

Codex

Plugin API/Action Reference/load-themes.php

Contents

Description

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

You can use it to execute something when your theme is activate or deactivate.

Usage

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

Example

add_action( 'load-themes.php', 'Init_theme' );
function Init_theme(){
  global $pagenow;

  if ( 'themes.php' == $pagenow && isset( $_GET['activated'] ) ){ // Test if theme is activate
    // What to do when theme is activate
  }
}

See also

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