current_theme_supports-<feature>
Filters whether the current theme supports a specific feature.
Description
apply_filters( 'current_theme_supports-<feature>', (bool) $true, (array) $args, (string) $wp_theme_features_feature );
The dynamic portion(s) of the hook name refer 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.
Parameters (3)
- 0. $true (bool) =>
true
- True Whether the current theme supports the given feature. Default true.
- 1. $args (array)
- Array of arguments for the feature.
- 2. $wp_theme_features_feature (string)
- The
wp
theme features feature.
Usage
- To run the hook, copy the example below.
- $true = apply_filters( 'current_theme_supports-{$feature}', $true, $args, $wp_theme_features_feature );
- if ( !empty( $true ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the current_theme_supports-<feature> callback
- function filter_current_theme_supports_feature( $true, $args, $wp_theme_features_feature ) {
- // make filter magic happen here...
- return $true;
- };
- // add the filter
- add_filter( "current_theme_supports-{$feature}", 'filter_current_theme_supports_feature', 10, 3 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( "current_theme_supports-{$feature}", 'filter_current_theme_supports_feature', 10, 3 );
Defined (1)
The filter is defined in the following location(s).
- /wp-includes/theme.php
- return apply_filters( "current_theme_supports-{$feature}", true, $args, $_wp_theme_features[$feature] );