Make WordPress Core

Ticket #26716: require_if_theme_supports+boolean.diff

File require_if_theme_supports+boolean.diff, 958 bytes (added by jeffsebring, 11 years ago)

Patch to add boolean return values to require_if_theme_supports

  • wp-includes/theme.php

     
    17231723 * Checks a theme's support for a given feature before loading the functions which implement it.
    17241724 *
    17251725 * @since 2.9.0
    1726  * @param string $feature the feature being checked
    1727  * @param string $include the file containing the functions that implement the feature
     1726 * @param string $feature The feature being checked.
     1727 * @param string $include The file containing the functions that implement the feature.
     1728 * @return boolean True if the current theme supports $feature.
    17281729 */
    1729 function require_if_theme_supports( $feature, $include) {
    1730         if ( current_theme_supports( $feature ) )
     1730function require_if_theme_supports( $feature, $include ) {
     1731        if ( current_theme_supports( $feature ) ) {
    17311732                require ( $include );
     1733                return true;
     1734        }
     1735        return false;
    17321736}
    17331737
    17341738/**