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