Allow a filter to disable the validate_current_theme() functionality
git-svn-id: http://svn.automattic.com/wordpress/trunk@9087 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
9d9607e6d6
commit
944306301a
|
@ -932,6 +932,8 @@ function switch_theme($template, $stylesheet) {
|
||||||
* Does not check the 'default' theme. The 'default' theme should always exist
|
* Does not check the 'default' theme. The 'default' theme should always exist
|
||||||
* or should have another theme renamed to that template name and directory
|
* or should have another theme renamed to that template name and directory
|
||||||
* path. Will switch theme to default if current theme does not validate.
|
* 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
|
* @since 1.5.0
|
||||||
*
|
*
|
||||||
|
@ -939,7 +941,7 @@ function switch_theme($template, $stylesheet) {
|
||||||
*/
|
*/
|
||||||
function validate_current_theme() {
|
function validate_current_theme() {
|
||||||
// Don't validate during an install/upgrade.
|
// Don't validate during an install/upgrade.
|
||||||
if ( defined('WP_INSTALLING') )
|
if ( defined('WP_INSTALLING') || !apply_filters( 'validate_current_theme', true ) )
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if ( get_template() != 'default' && !file_exists(get_template_directory() . '/index.php') ) {
|
if ( get_template() != 'default' && !file_exists(get_template_directory() . '/index.php') ) {
|
||||||
|
|
Loading…
Reference in New Issue