From ace51e5f6d89ecbd79d7be3415c18292e4cbf5c3 Mon Sep 17 00:00:00 2001 From: nacin Date: Fri, 27 Apr 2012 04:54:36 +0000 Subject: [PATCH] Deprecate require_if_theme_supports(). Always require post-thumbnail-template.php. fixes #20556. fixes #20409. git-svn-id: http://svn.automattic.com/wordpress/trunk@20610 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/deprecated.php | 16 ++++++++++++++++ wp-includes/theme.php | 12 ------------ wp-settings.php | 4 +--- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/wp-includes/deprecated.php b/wp-includes/deprecated.php index 13b6bff39ae5..d28e24e447e7 100644 --- a/wp-includes/deprecated.php +++ b/wp-includes/deprecated.php @@ -3152,3 +3152,19 @@ function clean_page_cache( $id ) { clean_post_cache( $id ); } + +/** + * Checks a theme's support for a given feature before loading the functions which implement it. + * + * @since 2.9.0 + * @deprecated 3.4.0 + * @deprecated Use require() + * + * @param string $feature the feature being checked + * @param string $include the file containing the functions that implement the feature + */ +function require_if_theme_supports( $feature, $include ) { + _deprecated_function( __FUNCTION__, '3.4', 'require()' ); + if ( current_theme_supports( $feature ) ) + require ( $include ); +} diff --git a/wp-includes/theme.php b/wp-includes/theme.php index d9ac780f9794..0cdc74e15280 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -1511,18 +1511,6 @@ function current_theme_supports( $feature ) { return apply_filters('current_theme_supports-' . $feature, true, $args, $_wp_theme_features[$feature]); } -/** - * Checks a theme's support for a given feature before loading the functions which implement it. - * - * @since 2.9.0 - * @param string $feature the feature being checked - * @param string $include the file containing the functions that implement the feature - */ -function require_if_theme_supports( $feature, $include) { - if ( current_theme_supports( $feature ) ) - require ( $include ); -} - /** * Checks an attachment being deleted to see if it's a header or background image. * diff --git a/wp-settings.php b/wp-settings.php index c18367abe9e7..cb950184f842 100644 --- a/wp-settings.php +++ b/wp-settings.php @@ -121,6 +121,7 @@ require( ABSPATH . WPINC . '/author-template.php' ); require( ABSPATH . WPINC . '/post.php' ); require( ABSPATH . WPINC . '/post-template.php' ); +require( ABSPATH . WPINC . '/post-thumbnail-template.php' ); require( ABSPATH . WPINC . '/category.php' ); require( ABSPATH . WPINC . '/category-template.php' ); require( ABSPATH . WPINC . '/comment.php' ); @@ -288,9 +289,6 @@ do_action( 'after_setup_theme' ); -// Load any template functions the theme supports. -require_if_theme_supports( 'post-thumbnails', ABSPATH . WPINC . '/post-thumbnail-template.php' ); - // Set up current user. $wp->init();