remove_custom_background()
云策文档标注
概述
remove_custom_background() 是一个已弃用的 WordPress 函数,用于移除主题的自定义背景支持。自 WordPress 3.4.0 起,推荐使用 remove_theme_support('custom-background') 替代。
关键要点
- 函数 remove_custom_background() 已弃用,自 WordPress 3.4.0 起应改用 remove_theme_support('custom-background')
- 该函数返回 null 或 bool 值,表示是否成功移除自定义背景支持
- 内部调用 _deprecated_function() 来标记函数为弃用,并在使用时发出通知
- 相关函数包括 remove_theme_support() 和 _deprecated_function()
注意事项
在开发主题或插件时,应避免使用此弃用函数,以保持代码兼容性和遵循 WordPress 最佳实践。
原文内容
Remove custom background support.
Description
See also
Source
function remove_custom_background() {
_deprecated_function( __FUNCTION__, '3.4.0', 'remove_theme_support( 'custom-background' )' );
return remove_theme_support( 'custom-background' );
}
Changelog
| Version | Description |
|---|---|
| 3.4.0 | Deprecated. Use add_custom_background() |
| 3.1.0 | Introduced. |