current_theme_supports-(feature) хук-фильтрWP 3.4.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.

Использование

add_filter( 'current_theme_supports-(feature)', 'wp_kama_current_theme_supports_feature_filter', 10, 3 );

/**
 * Function for `current_theme_supports-(feature)` filter-hook.
 * 
 * @param bool   $supports Whether the active theme supports the given feature.
 * @param array  $args     Array of arguments for the feature.
 * @param string $feature  The theme feature.
 *
 * @return bool
 */
function wp_kama_current_theme_supports_feature_filter( $supports, $args, $feature ){

	// filter...
	return $supports;
}
$supports(true|false)
Whether the active theme supports the given feature.
По умолчанию: true
$args(массив)
Array of arguments for the feature.
$feature(строка)
The theme feature.

Список изменений

С версии 3.4.0 Введена.

Где вызывается хук

current_theme_supports()
current_theme_supports-(feature)
wp-includes/theme.php 3118
return apply_filters( "current_theme_supports-{$feature}", true, $args, $_wp_theme_features[ $feature ] ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
wp-includes/theme.php 3072
return apply_filters( "current_theme_supports-{$feature}", true, $args, $_wp_theme_features[ $feature ] ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores

Где используется хук в WordPress

Использование не найдено.