remove_theme_support()
remove_theme_support( string $feature ) 允许主题取消注册对特定功能的支…
remove_theme_support( string $feature )
允许主题取消注册对特定功能的支持
Allows a theme to de-register its support of a certain feature
目录锚点:#说明#参数#返回#源码#笔记
说明(Description)
应该在主题的函数.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.
*/
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 |
笔记(Notes)
删除子主题中的功能
类别:WordPress 函数手册、
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。

还没有任何评论,赶紧来占个楼吧!