Make WordPress Core

Changeset 27217


Ignore:
Timestamp:
02/20/2014 10:10:32 PM (11 years ago)
Author:
SergeyBiryukov
Message:

Add boolean return values to require_if_theme_supports().

props jeffsebring, DrewAPicture.
fixes #26716.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/theme.php

    r26868 r27217  
    17251725 *
    17261726 * @since 2.9.0
    1727  * @param string $feature the feature being checked
    1728  * @param string $include the file containing the functions that implement the feature
    1729  */
    1730 function require_if_theme_supports( $feature, $include) {
    1731     if ( current_theme_supports( $feature ) )
     1727 *
     1728 * @param string $feature The feature being checked.
     1729 * @param string $include Path to the file.
     1730 * @return bool True if the current theme supports the supplied feature, false otherwise.
     1731 */
     1732function require_if_theme_supports( $feature, $include ) {
     1733    if ( current_theme_supports( $feature ) ) {
    17321734        require ( $include );
     1735        return true;
     1736    }
     1737    return false;
    17331738}
    17341739
Note: See TracChangeset for help on using the changeset viewer.