Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: switch_theme

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 2 times in this file.

Line Code
1178      $theme_loc = 'wp-content/themes';
1179      $theme_root = ABSPATH.$theme_loc;
1180
1181      $template = get_settings('template');
1182      $stylesheet = get_settings('stylesheet');
1183
1184      if (($template != 'default') && (!file_exists("$theme_root/$template/index.php"))) {
1185           update_option('template', 'default');
1186           update_option('stylesheet', 'default');
1187           do_action('switch_theme', 'Default');
1188           return false;
1189      }
1190
1191      if (($stylesheet != 'default') && (!file_exists("$theme_root/$stylesheet/style.css"))) {
1192           update_option('template', 'default');
1193           update_option('stylesheet', 'default');
1194           do_action('switch_theme', 'Default');
1195           return false;
1196      }
1197
1198      return true;
1199 }
1200
1201 function get_broken_themes() {
1202      global $wp_broken_themes;
1203