From b5e08827bce98c7485c77d89bce21b4892a6beef Mon Sep 17 00:00:00 2001 From: westi Date: Mon, 3 May 2010 13:23:34 +0000 Subject: [PATCH] Add a nag message for themes which are relying on the deprecated behaviour. git-svn-id: http://svn.automattic.com/wordpress/trunk@14369 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/theme.php | 31 +++++++++++++++++++++++++++++++ wp-admin/themes.php | 2 +- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/wp-admin/includes/theme.php b/wp-admin/includes/theme.php index 7ea20aacdc..95de9e3896 100644 --- a/wp-admin/includes/theme.php +++ b/wp-admin/includes/theme.php @@ -208,4 +208,35 @@ function _get_template_edit_filename($fullpath, $containingfolder) { return str_replace(dirname(dirname( $containingfolder )) , '', $fullpath); } +/** + * Check the current theme for reliance on deprecated theme compatibility + * + * Check to see if the current theme has all the required templates available + * from itself or its parent + * + * @return nothing + */ +function _check_theme_deprecated_files() { + $files = array( ); + + if ( ! locate_template( array( 'header.php' ) ) ) + $files[] = 'header.php'; + if ( ! locate_template( array( 'footer.php' ) ) ) + $files[] = 'footer.php'; + if ( ! locate_template( array( 'sidebar.php' ) ) ) + $files[] = 'sidebar.php'; + + // Only notify if both are missing as you can use one or the other + if ( ! ( $comment = locate_template( array( 'comments.php' ) ) ) && ! ( $comment_popup = locate_template( array( 'comments-popup.php' ) ) ) ) { + $files[] = 'comments.php'; + $files[] = 'comments-popup.php'; + } + + if ( ! empty( $files ) ) : ?> +

+ +

+ diff --git a/wp-admin/themes.php b/wp-admin/themes.php index 5a9f9e09c4..d351cbfc9c 100644 --- a/wp-admin/themes.php +++ b/wp-admin/themes.php @@ -59,8 +59,8 @@ if ( is_multisite() && current_user_can('edit_themes') ) { elseif ( isset($_GET['deleted']) ) : ?>

- name]);