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
414
415 function validate_current_theme() {
416      // Don't validate during an install/upgrade.
417      if ( defined('WP_INSTALLING') )
418           return true;
419
420      if ( get_template() != 'default' && !file_exists(get_template_directory() . '/index.php') ) {
421           update_option('template', 'default');
422           update_option('stylesheet', 'default');
423           do_action('switch_theme', 'Default');
424           return false;
425      }
426
427      if ( get_stylesheet() != 'default' && !file_exists(get_template_directory() . '/style.css') ) {
428           update_option('template', 'default');
429           update_option('stylesheet', 'default');
430           do_action('switch_theme', 'Default');
431           return false;
432      }
433
434      return true;
435 }
436
437 function get_theme_mod($name, $default = false) {
438      $theme = get_current_theme();
439