current_theme_supports

The timeline below displays how wordpress function current_theme_supports has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.1

/**
 * Checks a theme's support for a given feature.
 *
 * Example usage:
 *
 *     current_theme_supports( 'custom-logo' );
 *     current_theme_supports( 'html5', 'comment-form' );
 *
 * @since 2.9.0
 * @since 5.3.0 Formalized the existing and already documented `...$args` parameter
 *              by adding it to the function signature.
 *
 * @global array $_wp_theme_features
 *
 * @param string $feature The feature being checked. See add_theme_support() for the list
 *                        of possible values.
 * @param mixed  ...$args Optional extra arguments to be checked against certain features.
 * @return bool True if the active theme supports the feature, false otherwise.
 */
function current_theme_supports($feature, ...$args)
{
    global $_wp_theme_features;
    if ('custom-header-uploads' === $feature) {
        return current_theme_supports('custom-header', 'uploads');
    }
    if (!isset($_wp_theme_features[$feature])) {
        return false;
    }
    // If no args passed then no extra checks need to be performed.
    if (!$args) {
        /** This filter is documented in wp-includes/theme.php */
        return apply_filters("current_theme_supports-{$feature}", true, $args, $_wp_theme_features[$feature]);
        // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
    }
    switch ($feature) {
        case 'post-thumbnails':
            /*
             * post-thumbnails can be registered for only certain content/post types
             * by passing an array of types to add_theme_support().
             * If no array was passed, then any type is accepted.
             */
            if (true === $_wp_theme_features[$feature]) {
                // Registered for all types.
                return true;
            }
            $content_type = $args[0];
            return in_array($content_type, $_wp_theme_features[$feature][0], true);
        case 'html5':
        case 'post-formats':
            /*
             * Specific post formats can be registered by passing an array of types
             * to add_theme_support().
             *
             * Specific areas of HTML5 support *must* be passed via an array to add_theme_support().
             */
            $type = $args[0];
            return in_array($type, $_wp_theme_features[$feature][0], true);
        case 'custom-logo':
        case 'custom-header':
        case 'custom-background':
            // Specific capabilities can be registered by passing an array to add_theme_support().
            return isset($_wp_theme_features[$feature][0][$args[0]]) && $_wp_theme_features[$feature][0][$args[0]];
    }
    /**
     * Filters whether the active theme supports a specific feature.
     *
     * The dynamic portion of the hook name, `$feature`, refers to the specific
     * theme feature. See add_theme_support() for the list of possible values.
     *
     * @since 3.4.0
     *
     * @param bool   $supports Whether the active theme supports the given feature. Default true.
     * @param array  $args     Array of arguments for the feature.
     * @param string $feature  The theme feature.
     */
    return apply_filters("current_theme_supports-{$feature}", true, $args, $_wp_theme_features[$feature]);
    // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
}

WordPress Version: 5.5

/**
 * Checks a theme's support for a given feature.
 *
 * Example usage:
 *
 *     current_theme_supports( 'custom-logo' );
 *     current_theme_supports( 'html5', 'comment-form' );
 *
 * @since 2.9.0
 * @since 5.3.0 Formalized the existing and already documented `...$args` parameter
 *              by adding it to the function signature.
 *
 * @global array $_wp_theme_features
 *
 * @param string $feature The feature being checked. See add_theme_support() for the list
 *                        of possible values.
 * @param mixed  ...$args Optional extra arguments to be checked against certain features.
 * @return bool True if the current theme supports the feature, false otherwise.
 */
function current_theme_supports($feature, ...$args)
{
    global $_wp_theme_features;
    if ('custom-header-uploads' === $feature) {
        return current_theme_supports('custom-header', 'uploads');
    }
    if (!isset($_wp_theme_features[$feature])) {
        return false;
    }
    // If no args passed then no extra checks need be performed.
    if (!$args) {
        return true;
    }
    switch ($feature) {
        case 'post-thumbnails':
            /*
             * post-thumbnails can be registered for only certain content/post types
             * by passing an array of types to add_theme_support().
             * If no array was passed, then any type is accepted.
             */
            if (true === $_wp_theme_features[$feature]) {
                // Registered for all types.
                return true;
            }
            $content_type = $args[0];
            return in_array($content_type, $_wp_theme_features[$feature][0], true);
        case 'html5':
        case 'post-formats':
            /*
             * Specific post formats can be registered by passing an array of types
             * to add_theme_support().
             *
             * Specific areas of HTML5 support *must* be passed via an array to add_theme_support().
             */
            $type = $args[0];
            return in_array($type, $_wp_theme_features[$feature][0], true);
        case 'custom-logo':
        case 'custom-header':
        case 'custom-background':
            // Specific capabilities can be registered by passing an array to add_theme_support().
            return isset($_wp_theme_features[$feature][0][$args[0]]) && $_wp_theme_features[$feature][0][$args[0]];
    }
    /**
     * Filters whether the current theme supports a specific feature.
     *
     * The dynamic portion of the hook name, `$feature`, refers to the specific
     * theme feature. See add_theme_support() for the list of possible values.
     *
     * @since 3.4.0
     *
     * @param bool   $supports Whether the current theme supports the given feature. Default true.
     * @param array  $args     Array of arguments for the feature.
     * @param string $feature  The theme feature.
     */
    return apply_filters("current_theme_supports-{$feature}", true, $args, $_wp_theme_features[$feature]);
    // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
}

WordPress Version: 5.4

/**
 * Checks a theme's support for a given feature.
 *
 * Example usage:
 *
 *     current_theme_supports( 'custom-logo' );
 *     current_theme_supports( 'html5', 'comment-form' );
 *
 * @since 2.9.0
 * @since 5.3.0 Formalized the existing and already documented `...$args` parameter
 *              by adding it to the function signature.
 *
 * @global array $_wp_theme_features
 *
 * @param string $feature The feature being checked.
 * @param mixed  ...$args Optional extra arguments to be checked against certain features.
 * @return bool True if the current theme supports the feature, false otherwise.
 */
function current_theme_supports($feature, ...$args)
{
    global $_wp_theme_features;
    if ('custom-header-uploads' == $feature) {
        return current_theme_supports('custom-header', 'uploads');
    }
    if (!isset($_wp_theme_features[$feature])) {
        return false;
    }
    // If no args passed then no extra checks need be performed.
    if (!$args) {
        return true;
    }
    switch ($feature) {
        case 'post-thumbnails':
            /*
             * post-thumbnails can be registered for only certain content/post types
             * by passing an array of types to add_theme_support().
             * If no array was passed, then any type is accepted.
             */
            if (true === $_wp_theme_features[$feature]) {
                // Registered for all types
                return true;
            }
            $content_type = $args[0];
            return in_array($content_type, $_wp_theme_features[$feature][0]);
        case 'html5':
        case 'post-formats':
            /*
             * Specific post formats can be registered by passing an array of types
             * to add_theme_support().
             *
             * Specific areas of HTML5 support *must* be passed via an array to add_theme_support().
             */
            $type = $args[0];
            return in_array($type, $_wp_theme_features[$feature][0]);
        case 'custom-logo':
        case 'custom-header':
        case 'custom-background':
            // Specific capabilities can be registered by passing an array to add_theme_support().
            return isset($_wp_theme_features[$feature][0][$args[0]]) && $_wp_theme_features[$feature][0][$args[0]];
    }
    /**
     * Filters whether the current theme supports a specific feature.
     *
     * The dynamic portion of the hook name, `$feature`, refers to the specific theme
     * feature. Possible values include 'post-formats', 'post-thumbnails', 'custom-background',
     * 'custom-header', 'menus', 'automatic-feed-links', 'html5',
     * 'starter-content', and 'customize-selective-refresh-widgets'.
     *
     * @since 3.4.0
     *
     * @param bool   $supports Whether the current theme supports the given feature. Default true.
     * @param array  $args     Array of arguments for the feature.
     * @param string $feature  The theme feature.
     */
    return apply_filters("current_theme_supports-{$feature}", true, $args, $_wp_theme_features[$feature]);
    // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
}

WordPress Version: 5.3

/**
 * Checks a theme's support for a given feature.
 *
 * Example usage:
 *
 *     current_theme_supports( 'custom-logo' );
 *     current_theme_supports( 'html5', 'comment-form' );
 *
 * @since 2.9.0
 * @since 5.3.0 Formalized the existing and already documented `...$args` parameter
 *              by adding it to the function signature.
 *
 * @global array $_wp_theme_features
 *
 * @param string $feature The feature being checked.
 * @param mixed  ...$args Optional extra arguments to be checked against certain features.
 * @return bool True if the current theme supports the feature, false otherwise.
 */
function current_theme_supports($feature, ...$args)
{
    global $_wp_theme_features;
    if ('custom-header-uploads' == $feature) {
        return current_theme_supports('custom-header', 'uploads');
    }
    if (!isset($_wp_theme_features[$feature])) {
        return false;
    }
    // If no args passed then no extra checks need be performed
    if (!$args) {
        return true;
    }
    switch ($feature) {
        case 'post-thumbnails':
            // post-thumbnails can be registered for only certain content/post types by passing
            // an array of types to add_theme_support(). If no array was passed, then
            // any type is accepted
            if (true === $_wp_theme_features[$feature]) {
                // Registered for all types
                return true;
            }
            $content_type = $args[0];
            return in_array($content_type, $_wp_theme_features[$feature][0]);
        case 'html5':
        case 'post-formats':
            // specific post formats can be registered by passing an array of types to
            // add_theme_support()
            // Specific areas of HTML5 support *must* be passed via an array to add_theme_support()
            $type = $args[0];
            return in_array($type, $_wp_theme_features[$feature][0]);
        case 'custom-logo':
        case 'custom-header':
        case 'custom-background':
            // Specific capabilities can be registered by passing an array to add_theme_support().
            return isset($_wp_theme_features[$feature][0][$args[0]]) && $_wp_theme_features[$feature][0][$args[0]];
    }
    /**
     * Filters whether the current theme supports a specific feature.
     *
     * The dynamic portion of the hook name, `$feature`, refers to the specific theme
     * feature. Possible values include 'post-formats', 'post-thumbnails', 'custom-background',
     * 'custom-header', 'menus', 'automatic-feed-links', 'html5',
     * 'starter-content', and 'customize-selective-refresh-widgets'.
     *
     * @since 3.4.0
     *
     * @param bool   true     Whether the current theme supports the given feature. Default true.
     * @param array  $args    Array of arguments for the feature.
     * @param string $feature The theme feature.
     */
    return apply_filters("current_theme_supports-{$feature}", true, $args, $_wp_theme_features[$feature]);
    // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
}

WordPress Version: 5.2

/**
 * Checks a theme's support for a given feature.
 *
 * @since 2.9.0
 *
 * @global array $_wp_theme_features
 *
 * @param string $feature The feature being checked.
 * @return bool True if the current theme supports the feature, false otherwise.
 */
function current_theme_supports($feature)
{
    global $_wp_theme_features;
    if ('custom-header-uploads' == $feature) {
        return current_theme_supports('custom-header', 'uploads');
    }
    if (!isset($_wp_theme_features[$feature])) {
        return false;
    }
    // If no args passed then no extra checks need be performed
    if (func_num_args() <= 1) {
        return true;
    }
    $args = array_slice(func_get_args(), 1);
    switch ($feature) {
        case 'post-thumbnails':
            // post-thumbnails can be registered for only certain content/post types by passing
            // an array of types to add_theme_support(). If no array was passed, then
            // any type is accepted
            if (true === $_wp_theme_features[$feature]) {
                // Registered for all types
                return true;
            }
            $content_type = $args[0];
            return in_array($content_type, $_wp_theme_features[$feature][0]);
        case 'html5':
        case 'post-formats':
            // specific post formats can be registered by passing an array of types to
            // add_theme_support()
            // Specific areas of HTML5 support *must* be passed via an array to add_theme_support()
            $type = $args[0];
            return in_array($type, $_wp_theme_features[$feature][0]);
        case 'custom-logo':
        case 'custom-header':
        case 'custom-background':
            // Specific capabilities can be registered by passing an array to add_theme_support().
            return isset($_wp_theme_features[$feature][0][$args[0]]) && $_wp_theme_features[$feature][0][$args[0]];
    }
    /**
     * Filters whether the current theme supports a specific feature.
     *
     * The dynamic portion of the hook name, `$feature`, refers to the specific theme
     * feature. Possible values include 'post-formats', 'post-thumbnails', 'custom-background',
     * 'custom-header', 'menus', 'automatic-feed-links', 'html5',
     * 'starter-content', and 'customize-selective-refresh-widgets'.
     *
     * @since 3.4.0
     *
     * @param bool   true     Whether the current theme supports the given feature. Default true.
     * @param array  $args    Array of arguments for the feature.
     * @param string $feature The theme feature.
     */
    return apply_filters("current_theme_supports-{$feature}", true, $args, $_wp_theme_features[$feature]);
}

WordPress Version: 4.7

/**
 * Checks a theme's support for a given feature
 *
 * @since 2.9.0
 *
 * @global array $_wp_theme_features
 *
 * @param string $feature the feature being checked
 * @return bool
 */
function current_theme_supports($feature)
{
    global $_wp_theme_features;
    if ('custom-header-uploads' == $feature) {
        return current_theme_supports('custom-header', 'uploads');
    }
    if (!isset($_wp_theme_features[$feature])) {
        return false;
    }
    // If no args passed then no extra checks need be performed
    if (func_num_args() <= 1) {
        return true;
    }
    $args = array_slice(func_get_args(), 1);
    switch ($feature) {
        case 'post-thumbnails':
            // post-thumbnails can be registered for only certain content/post types by passing
            // an array of types to add_theme_support(). If no array was passed, then
            // any type is accepted
            if (true === $_wp_theme_features[$feature]) {
                // Registered for all types
                return true;
            }
            $content_type = $args[0];
            return in_array($content_type, $_wp_theme_features[$feature][0]);
        case 'html5':
        case 'post-formats':
            // specific post formats can be registered by passing an array of types to
            // add_theme_support()
            // Specific areas of HTML5 support *must* be passed via an array to add_theme_support()
            $type = $args[0];
            return in_array($type, $_wp_theme_features[$feature][0]);
        case 'custom-logo':
        case 'custom-header':
        case 'custom-background':
            // Specific capabilities can be registered by passing an array to add_theme_support().
            return isset($_wp_theme_features[$feature][0][$args[0]]) && $_wp_theme_features[$feature][0][$args[0]];
    }
    /**
     * Filters whether the current theme supports a specific feature.
     *
     * The dynamic portion of the hook name, `$feature`, refers to the specific theme
     * feature. Possible values include 'post-formats', 'post-thumbnails', 'custom-background',
     * 'custom-header', 'menus', 'automatic-feed-links', 'html5',
     * 'starter-content', and 'customize-selective-refresh-widgets'.
     *
     * @since 3.4.0
     *
     * @param bool   true     Whether the current theme supports the given feature. Default true.
     * @param array  $args    Array of arguments for the feature.
     * @param string $feature The theme feature.
     */
    return apply_filters("current_theme_supports-{$feature}", true, $args, $_wp_theme_features[$feature]);
}

WordPress Version: 4.6

/**
 * Checks a theme's support for a given feature
 *
 * @since 2.9.0
 *
 * @global array $_wp_theme_features
 *
 * @param string $feature the feature being checked
 * @return bool
 */
function current_theme_supports($feature)
{
    global $_wp_theme_features;
    if ('custom-header-uploads' == $feature) {
        return current_theme_supports('custom-header', 'uploads');
    }
    if (!isset($_wp_theme_features[$feature])) {
        return false;
    }
    // If no args passed then no extra checks need be performed
    if (func_num_args() <= 1) {
        return true;
    }
    $args = array_slice(func_get_args(), 1);
    switch ($feature) {
        case 'post-thumbnails':
            // post-thumbnails can be registered for only certain content/post types by passing
            // an array of types to add_theme_support(). If no array was passed, then
            // any type is accepted
            if (true === $_wp_theme_features[$feature]) {
                // Registered for all types
                return true;
            }
            $content_type = $args[0];
            return in_array($content_type, $_wp_theme_features[$feature][0]);
        case 'html5':
        case 'post-formats':
            // specific post formats can be registered by passing an array of types to
            // add_theme_support()
            // Specific areas of HTML5 support *must* be passed via an array to add_theme_support()
            $type = $args[0];
            return in_array($type, $_wp_theme_features[$feature][0]);
        case 'custom-logo':
        case 'custom-header':
        case 'custom-background':
            // Specific capabilities can be registered by passing an array to add_theme_support().
            return isset($_wp_theme_features[$feature][0][$args[0]]) && $_wp_theme_features[$feature][0][$args[0]];
    }
    /**
     * Filters whether the current theme supports a specific feature.
     *
     * The dynamic portion of the hook name, `$feature`, refers to the specific theme
     * feature. Possible values include 'post-formats', 'post-thumbnails', 'custom-background',
     * 'custom-header', 'menus', 'automatic-feed-links', 'html5', and `customize-selective-refresh-widgets`.
     *
     * @since 3.4.0
     *
     * @param bool   true     Whether the current theme supports the given feature. Default true.
     * @param array  $args    Array of arguments for the feature.
     * @param string $feature The theme feature.
     */
    return apply_filters("current_theme_supports-{$feature}", true, $args, $_wp_theme_features[$feature]);
}

WordPress Version: 4.5

/**
 * Checks a theme's support for a given feature
 *
 * @since 2.9.0
 *
 * @global array $_wp_theme_features
 *
 * @param string $feature the feature being checked
 * @return bool
 */
function current_theme_supports($feature)
{
    global $_wp_theme_features;
    if ('custom-header-uploads' == $feature) {
        return current_theme_supports('custom-header', 'uploads');
    }
    if (!isset($_wp_theme_features[$feature])) {
        return false;
    }
    // If no args passed then no extra checks need be performed
    if (func_num_args() <= 1) {
        return true;
    }
    $args = array_slice(func_get_args(), 1);
    switch ($feature) {
        case 'post-thumbnails':
            // post-thumbnails can be registered for only certain content/post types by passing
            // an array of types to add_theme_support(). If no array was passed, then
            // any type is accepted
            if (true === $_wp_theme_features[$feature]) {
                // Registered for all types
                return true;
            }
            $content_type = $args[0];
            return in_array($content_type, $_wp_theme_features[$feature][0]);
        case 'html5':
        case 'post-formats':
            // specific post formats can be registered by passing an array of types to
            // add_theme_support()
            // Specific areas of HTML5 support *must* be passed via an array to add_theme_support()
            $type = $args[0];
            return in_array($type, $_wp_theme_features[$feature][0]);
        case 'custom-logo':
        case 'custom-header':
        case 'custom-background':
            // Specific capabilities can be registered by passing an array to add_theme_support().
            return isset($_wp_theme_features[$feature][0][$args[0]]) && $_wp_theme_features[$feature][0][$args[0]];
    }
    /**
     * Filter whether the current theme supports a specific feature.
     *
     * The dynamic portion of the hook name, `$feature`, refers to the specific theme
     * feature. Possible values include 'post-formats', 'post-thumbnails', 'custom-background',
     * 'custom-header', 'menus', 'automatic-feed-links', 'html5', and `customize-selective-refresh-widgets`.
     *
     * @since 3.4.0
     *
     * @param bool   true     Whether the current theme supports the given feature. Default true.
     * @param array  $args    Array of arguments for the feature.
     * @param string $feature The theme feature.
     */
    return apply_filters("current_theme_supports-{$feature}", true, $args, $_wp_theme_features[$feature]);
}

WordPress Version: 4.4

/**
 * Checks a theme's support for a given feature
 *
 * @since 2.9.0
 *
 * @global array $_wp_theme_features
 *
 * @param string $feature the feature being checked
 * @return bool
 */
function current_theme_supports($feature)
{
    global $_wp_theme_features;
    if ('custom-header-uploads' == $feature) {
        return current_theme_supports('custom-header', 'uploads');
    }
    if (!isset($_wp_theme_features[$feature])) {
        return false;
    }
    // If no args passed then no extra checks need be performed
    if (func_num_args() <= 1) {
        return true;
    }
    $args = array_slice(func_get_args(), 1);
    switch ($feature) {
        case 'post-thumbnails':
            // post-thumbnails can be registered for only certain content/post types by passing
            // an array of types to add_theme_support(). If no array was passed, then
            // any type is accepted
            if (true === $_wp_theme_features[$feature]) {
                // Registered for all types
                return true;
            }
            $content_type = $args[0];
            return in_array($content_type, $_wp_theme_features[$feature][0]);
        case 'html5':
        case 'post-formats':
            // specific post formats can be registered by passing an array of types to
            // add_theme_support()
            // Specific areas of HTML5 support *must* be passed via an array to add_theme_support()
            $type = $args[0];
            return in_array($type, $_wp_theme_features[$feature][0]);
        case 'custom-header':
        case 'custom-background':
            // specific custom header and background capabilities can be registered by passing
            // an array to add_theme_support()
            $header_support = $args[0];
            return isset($_wp_theme_features[$feature][0][$header_support]) && $_wp_theme_features[$feature][0][$header_support];
    }
    /**
     * Filter whether the current theme supports a specific feature.
     *
     * The dynamic portion of the hook name, `$feature`, refers to the specific theme
     * feature. Possible values include 'post-formats', 'post-thumbnails', 'custom-background',
     * 'custom-header', 'menus', 'automatic-feed-links', and 'html5'.
     *
     * @since 3.4.0
     *
     * @param bool   true     Whether the current theme supports the given feature. Default true.
     * @param array  $args    Array of arguments for the feature.
     * @param string $feature The theme feature.
     */
    return apply_filters("current_theme_supports-{$feature}", true, $args, $_wp_theme_features[$feature]);
}

WordPress Version: 4.3

/**
 * Checks a theme's support for a given feature
 *
 * @since 2.9.0
 *
 * @global array $_wp_theme_features
 *
 * @param string $feature the feature being checked
 * @return bool
 */
function current_theme_supports($feature)
{
    global $_wp_theme_features;
    if ('custom-header-uploads' == $feature) {
        return current_theme_supports('custom-header', 'uploads');
    }
    if (!isset($_wp_theme_features[$feature])) {
        return false;
    }
    if ('title-tag' == $feature) {
        // Don't confirm support unless called internally.
        $trace = debug_backtrace();
        if (!in_array($trace[1]['function'], array('_wp_render_title_tag', 'wp_title'))) {
            return false;
        }
    }
    // If no args passed then no extra checks need be performed
    if (func_num_args() <= 1) {
        return true;
    }
    $args = array_slice(func_get_args(), 1);
    switch ($feature) {
        case 'post-thumbnails':
            // post-thumbnails can be registered for only certain content/post types by passing
            // an array of types to add_theme_support(). If no array was passed, then
            // any type is accepted
            if (true === $_wp_theme_features[$feature]) {
                // Registered for all types
                return true;
            }
            $content_type = $args[0];
            return in_array($content_type, $_wp_theme_features[$feature][0]);
        case 'html5':
        case 'post-formats':
            // specific post formats can be registered by passing an array of types to
            // add_theme_support()
            // Specific areas of HTML5 support *must* be passed via an array to add_theme_support()
            $type = $args[0];
            return in_array($type, $_wp_theme_features[$feature][0]);
        case 'custom-header':
        case 'custom-background':
            // specific custom header and background capabilities can be registered by passing
            // an array to add_theme_support()
            $header_support = $args[0];
            return isset($_wp_theme_features[$feature][0][$header_support]) && $_wp_theme_features[$feature][0][$header_support];
    }
    /**
     * Filter whether the current theme supports a specific feature.
     *
     * The dynamic portion of the hook name, `$feature`, refers to the specific theme
     * feature. Possible values include 'post-formats', 'post-thumbnails', 'custom-background',
     * 'custom-header', 'menus', 'automatic-feed-links', and 'html5'.
     *
     * @since 3.4.0
     *
     * @param bool   true     Whether the current theme supports the given feature. Default true.
     * @param array  $args    Array of arguments for the feature.
     * @param string $feature The theme feature.
     */
    return apply_filters("current_theme_supports-{$feature}", true, $args, $_wp_theme_features[$feature]);
}

WordPress Version: 4.1

/**
 * Checks a theme's support for a given feature
 *
 * @since 2.9.0
 * @param string $feature the feature being checked
 * @return boolean
 */
function current_theme_supports($feature)
{
    global $_wp_theme_features;
    if ('custom-header-uploads' == $feature) {
        return current_theme_supports('custom-header', 'uploads');
    }
    if (!isset($_wp_theme_features[$feature])) {
        return false;
    }
    if ('title-tag' == $feature) {
        // Don't confirm support unless called internally.
        $trace = debug_backtrace();
        if (!in_array($trace[1]['function'], array('_wp_render_title_tag', 'wp_title'))) {
            return false;
        }
    }
    // If no args passed then no extra checks need be performed
    if (func_num_args() <= 1) {
        return true;
    }
    $args = array_slice(func_get_args(), 1);
    switch ($feature) {
        case 'post-thumbnails':
            // post-thumbnails can be registered for only certain content/post types by passing
            // an array of types to add_theme_support(). If no array was passed, then
            // any type is accepted
            if (true === $_wp_theme_features[$feature]) {
                // Registered for all types
                return true;
            }
            $content_type = $args[0];
            return in_array($content_type, $_wp_theme_features[$feature][0]);
        case 'html5':
        case 'post-formats':
            // specific post formats can be registered by passing an array of types to
            // add_theme_support()
            // Specific areas of HTML5 support *must* be passed via an array to add_theme_support()
            $type = $args[0];
            return in_array($type, $_wp_theme_features[$feature][0]);
        case 'custom-header':
        case 'custom-background':
            // specific custom header and background capabilities can be registered by passing
            // an array to add_theme_support()
            $header_support = $args[0];
            return isset($_wp_theme_features[$feature][0][$header_support]) && $_wp_theme_features[$feature][0][$header_support];
    }
    /**
     * Filter whether the current theme supports a specific feature.
     *
     * The dynamic portion of the hook name, `$feature`, refers to the specific theme
     * feature. Possible values include 'post-formats', 'post-thumbnails', 'custom-background',
     * 'custom-header', 'menus', 'automatic-feed-links', and 'html5'.
     *
     * @since 3.4.0
     *
     * @param bool   true     Whether the current theme supports the given feature. Default true.
     * @param array  $args    Array of arguments for the feature.
     * @param string $feature The theme feature.
     */
    return apply_filters("current_theme_supports-{$feature}", true, $args, $_wp_theme_features[$feature]);
}

WordPress Version: 4.0

/**
 * Checks a theme's support for a given feature
 *
 * @since 2.9.0
 * @param string $feature the feature being checked
 * @return boolean
 */
function current_theme_supports($feature)
{
    global $_wp_theme_features;
    if ('custom-header-uploads' == $feature) {
        return current_theme_supports('custom-header', 'uploads');
    }
    if (!isset($_wp_theme_features[$feature])) {
        return false;
    }
    // If no args passed then no extra checks need be performed
    if (func_num_args() <= 1) {
        return true;
    }
    $args = array_slice(func_get_args(), 1);
    switch ($feature) {
        case 'post-thumbnails':
            // post-thumbnails can be registered for only certain content/post types by passing
            // an array of types to add_theme_support(). If no array was passed, then
            // any type is accepted
            if (true === $_wp_theme_features[$feature]) {
                // Registered for all types
                return true;
            }
            $content_type = $args[0];
            return in_array($content_type, $_wp_theme_features[$feature][0]);
        case 'html5':
        case 'post-formats':
            // specific post formats can be registered by passing an array of types to
            // add_theme_support()
            // Specific areas of HTML5 support *must* be passed via an array to add_theme_support()
            $type = $args[0];
            return in_array($type, $_wp_theme_features[$feature][0]);
        case 'custom-header':
        case 'custom-background':
            // specific custom header and background capabilities can be registered by passing
            // an array to add_theme_support()
            $header_support = $args[0];
            return isset($_wp_theme_features[$feature][0][$header_support]) && $_wp_theme_features[$feature][0][$header_support];
    }
    /**
     * Filter whether the current theme supports a specific feature.
     *
     * The dynamic portion of the hook name, $feature, refers to
     * the specific theme feature. Possible values include 'post-formats',
     * 'post-thumbnails', 'custom-background', 'custom-header', 'menus',
     * 'automatic-feed-links', and 'html5'.
     *
     * @since 3.4.0
     *
     * @param bool   true     Whether the current theme supports the given feature. Default true.
     * @param array  $args    Array of arguments for the feature.
     * @param string $feature The theme feature.
     */
    return apply_filters("current_theme_supports-{$feature}", true, $args, $_wp_theme_features[$feature]);
}

WordPress Version: 3.8

/**
 * Checks a theme's support for a given feature
 *
 * @since 2.9.0
 * @param string $feature the feature being checked
 * @return boolean
 */
function current_theme_supports($feature)
{
    global $_wp_theme_features;
    if ('custom-header-uploads' == $feature) {
        return current_theme_supports('custom-header', 'uploads');
    }
    if (!isset($_wp_theme_features[$feature])) {
        return false;
    }
    // If no args passed then no extra checks need be performed
    if (func_num_args() <= 1) {
        return true;
    }
    $args = array_slice(func_get_args(), 1);
    switch ($feature) {
        case 'post-thumbnails':
            // post-thumbnails can be registered for only certain content/post types by passing
            // an array of types to add_theme_support(). If no array was passed, then
            // any type is accepted
            if (true === $_wp_theme_features[$feature]) {
                // Registered for all types
                return true;
            }
            $content_type = $args[0];
            return in_array($content_type, $_wp_theme_features[$feature][0]);
            break;
        case 'html5':
        case 'post-formats':
            // specific post formats can be registered by passing an array of types to
            // add_theme_support()
            // Specific areas of HTML5 support *must* be passed via an array to add_theme_support()
            $type = $args[0];
            return in_array($type, $_wp_theme_features[$feature][0]);
            break;
        case 'custom-header':
        case 'custom-background':
            // specific custom header and background capabilities can be registered by passing
            // an array to add_theme_support()
            $header_support = $args[0];
            return isset($_wp_theme_features[$feature][0][$header_support]) && $_wp_theme_features[$feature][0][$header_support];
            break;
    }
    /**
     * Filter whether the current theme supports a specific feature.
     *
     * The dynamic portion of the hook name, $feature, refers to
     * the specific theme feature. Possible values include 'post-formats',
     * 'post-thumbnails', 'custom-background', 'custom-header', 'menus',
     * 'automatic-feed-links', and 'html5'.
     *
     * @since 3.4.0
     *
     * @param bool   true     Whether the current theme supports the given feature. Default true.
     * @param array  $args    Array of arguments for the feature.
     * @param string $feature The theme feature.
     */
    return apply_filters("current_theme_supports-{$feature}", true, $args, $_wp_theme_features[$feature]);
}

WordPress Version: 3.7

/**
 * Checks a theme's support for a given feature
 *
 * @since 2.9.0
 * @param string $feature the feature being checked
 * @return boolean
 */
function current_theme_supports($feature)
{
    global $_wp_theme_features;
    if ('custom-header-uploads' == $feature) {
        return current_theme_supports('custom-header', 'uploads');
    }
    if (!isset($_wp_theme_features[$feature])) {
        return false;
    }
    // If no args passed then no extra checks need be performed
    if (func_num_args() <= 1) {
        return true;
    }
    $args = array_slice(func_get_args(), 1);
    switch ($feature) {
        case 'post-thumbnails':
            // post-thumbnails can be registered for only certain content/post types by passing
            // an array of types to add_theme_support(). If no array was passed, then
            // any type is accepted
            if (true === $_wp_theme_features[$feature]) {
                // Registered for all types
                return true;
            }
            $content_type = $args[0];
            return in_array($content_type, $_wp_theme_features[$feature][0]);
            break;
        case 'html5':
        case 'post-formats':
            // specific post formats can be registered by passing an array of types to
            // add_theme_support()
            // Specific areas of HTML5 support *must* be passed via an array to add_theme_support()
            $type = $args[0];
            return in_array($type, $_wp_theme_features[$feature][0]);
            break;
        case 'custom-header':
        case 'custom-background':
            // specific custom header and background capabilities can be registered by passing
            // an array to add_theme_support()
            $header_support = $args[0];
            return isset($_wp_theme_features[$feature][0][$header_support]) && $_wp_theme_features[$feature][0][$header_support];
            break;
    }
    return apply_filters('current_theme_supports-' . $feature, true, $args, $_wp_theme_features[$feature]);
}