From ca2acfa8312b1d55a4bcdc138e60fbe5dafc3da3 Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Mon, 6 Oct 2008 15:29:47 +0000 Subject: [PATCH] Allow a filter to disable the validate_current_theme() functionality git-svn-id: https://develop.svn.wordpress.org/trunk@9087 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/theme.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-includes/theme.php b/wp-includes/theme.php index 943a8a2cd1..e86e9a1569 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -932,6 +932,8 @@ function switch_theme($template, $stylesheet) { * Does not check the 'default' theme. The 'default' theme should always exist * or should have another theme renamed to that template name and directory * path. Will switch theme to default if current theme does not validate. + * You can use the 'validate_current_theme' filter to return FALSE to + * disable this functionality. * * @since 1.5.0 * @@ -939,7 +941,7 @@ function switch_theme($template, $stylesheet) { */ function validate_current_theme() { // Don't validate during an install/upgrade. - if ( defined('WP_INSTALLING') ) + if ( defined('WP_INSTALLING') || !apply_filters( 'validate_current_theme', true ) ) return true; if ( get_template() != 'default' && !file_exists(get_template_directory() . '/index.php') ) {