From 0ccc5db0dd869a99b9449dbd290aaeb1b7c586d4 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 20 Feb 2014 22:10:32 +0000 Subject: [PATCH] Add boolean return values to require_if_theme_supports(). props jeffsebring, DrewAPicture. fixes #26716. git-svn-id: https://develop.svn.wordpress.org/trunk@27217 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/theme.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/wp-includes/theme.php b/src/wp-includes/theme.php index 0ae8a8ba36..76aa9550ae 100644 --- a/src/wp-includes/theme.php +++ b/src/wp-includes/theme.php @@ -1724,12 +1724,17 @@ function current_theme_supports( $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 + * + * @param string $feature The feature being checked. + * @param string $include Path to the file. + * @return bool True if the current theme supports the supplied feature, false otherwise. */ -function require_if_theme_supports( $feature, $include) { - if ( current_theme_supports( $feature ) ) +function require_if_theme_supports( $feature, $include ) { + if ( current_theme_supports( $feature ) ) { require ( $include ); + return true; + } + return false; } /**