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
449
450 function validate_current_theme() {
451      // Don't validate during an install/upgrade.
452      if ( defined('WP_INSTALLING') )
453           return true;
454
455      if ( get_template() != 'default' && !file_exists(get_template_directory() . '/index.php') ) {
456           update_option('template', 'default');
457           update_option('stylesheet', 'default');
458           do_action('switch_theme', 'Default');
459           return false;
460      }
461
462      if ( get_stylesheet() != 'default' && !file_exists(get_template_directory() . '/style.css') ) {
463           update_option('template', 'default');
464           update_option('stylesheet', 'default');
465           do_action('switch_theme', 'Default');
466           return false;
467      }
468
469      return true;
470 }
471
472 function get_theme_mod($name, $default = false) {
473      $theme = get_current_theme();
474