preview_theme_ob_filter()
云策文档标注
概述
preview_theme_ob_filter() 是一个用于捕获主题中所有链接的 ob_start() 回调函数,已在 WordPress 4.3.0 版本中被弃用。
关键要点
- 这是一个回调函数,用于 ob_start() 以捕获主题中的链接。
- 函数已被弃用,从 WordPress 4.3.0 版本开始不建议使用。
- 函数接受一个必需的字符串参数 $content,并返回一个字符串。
- 相关函数包括 _deprecated_function(),用于标记函数为弃用并通知使用情况。
代码示例
function preview_theme_ob_filter( $content ) {
_deprecated_function( __FUNCTION__, '4.3.0' );
return $content;
}注意事项
- 此函数在 WordPress 2.6.0 版本中引入,在 4.3.0 版本中被弃用,开发者应避免在新代码中使用。
原文内容
Callback function for ob_start() to capture all links in the theme.
Parameters
$contentstringrequired
Source
function preview_theme_ob_filter( $content ) {
_deprecated_function( __FUNCTION__, '4.3.0' );
return $content;
}