允许主题取消注册对特定功能的支持
remove_theme_support( string $feature )
说明(Description)
应该在主题的function.php文件。通常用于子主题以覆盖父主题的支持。
参数(Parameters)
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
$feature | (string) | 必需 | 正在删除的功能。 |
返回(Return)
(bool|void)是否删除了功能。
源码(Source)
/**
* Allows a theme to de-register its support of a certain feature
*
* Should be called in the theme's functions.php file. Generally would
* be used for child themes to override support from the parent theme.
*
* @since 3.0.0
* @see add_theme_support()
* @param string $feature the feature being added
* @return bool|void Whether feature was removed.
* 星空站长网 (zz2zz.com)
*/
function remove_theme_support( $feature ) {
// Blacklist: for internal registrations not used directly by themes.
if ( in_array( $feature, array( 'editor-style', 'widgets', 'menus' ) ) )
return false;
return _remove_theme_support( $feature );
}
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
3.0.0 | wp-includes/theme.php:2739 | 2 | 1 function |