Skip to content

Commit

Permalink
Deprecate require_if_theme_supports(). Always require post-thumbnail-…
Browse files Browse the repository at this point in the history
…template.php. fixes #20556. fixes #20409.

git-svn-id: http://svn.automattic.com/wordpress/trunk@20610 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
nacin committed Apr 27, 2012
1 parent 45d66d7 commit ace51e5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
16 changes: 16 additions & 0 deletions wp-includes/deprecated.php
Expand Up @@ -3152,3 +3152,19 @@ function clean_page_cache( $id ) {


clean_post_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 );
}
12 changes: 0 additions & 12 deletions wp-includes/theme.php
Expand Up @@ -1511,18 +1511,6 @@ function current_theme_supports( $feature ) {
return apply_filters('current_theme_supports-' . $feature, true, $args, $_wp_theme_features[$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. * Checks an attachment being deleted to see if it's a header or background image.
* *
Expand Down
4 changes: 1 addition & 3 deletions wp-settings.php
Expand Up @@ -121,6 +121,7 @@
require( ABSPATH . WPINC . '/author-template.php' ); require( ABSPATH . WPINC . '/author-template.php' );
require( ABSPATH . WPINC . '/post.php' ); require( ABSPATH . WPINC . '/post.php' );
require( ABSPATH . WPINC . '/post-template.php' ); require( ABSPATH . WPINC . '/post-template.php' );
require( ABSPATH . WPINC . '/post-thumbnail-template.php' );
require( ABSPATH . WPINC . '/category.php' ); require( ABSPATH . WPINC . '/category.php' );
require( ABSPATH . WPINC . '/category-template.php' ); require( ABSPATH . WPINC . '/category-template.php' );
require( ABSPATH . WPINC . '/comment.php' ); require( ABSPATH . WPINC . '/comment.php' );
Expand Down Expand Up @@ -288,9 +289,6 @@


do_action( 'after_setup_theme' ); 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. // Set up current user.
$wp->init(); $wp->init();


Expand Down

0 comments on commit ace51e5

Please sign in to comment.