wp_get_default_privacy_policy_content
云策文档标注
概述
wp_get_default_privacy_policy_content 是一个已弃用的过滤器,用于修改建议包含在隐私政策中的默认内容。自 WordPress 5.7.0 起,推荐使用 wp_add_privacy_policy_content() 替代。
关键要点
- 这是一个过滤器,允许开发者自定义隐私政策的默认内容。
- 接受参数:$content(默认内容字符串)、$strings(内容字符串数组)、$description(是否包含描述)、$blocks(是否格式化为块编辑器)。
- 自 5.7.0 版本起已弃用,应改用 wp_add_privacy_policy_content()。
- 历史版本:5.0.0 添加了 $strings、$description 和 $blocks 参数;4.9.6 引入。
注意事项
由于此过滤器已弃用,建议在开发中避免使用,转而采用 wp_add_privacy_policy_content() 函数来添加隐私政策内容。
原文内容
Filters the default content suggested for inclusion in a privacy policy.
Parameters
$contentstring-
The default policy content.
$stringsstring[]-
An array of privacy policy content strings.
$descriptionbool-
Whether policy descriptions should be included.
$blocksbool-
Whether the content should be formatted for the block editor.
Source
return apply_filters_deprecated(
'wp_get_default_privacy_policy_content',
array( $content, $strings, $description, $blocks ),
'5.7.0',
'wp_add_privacy_policy_content()'
);
Changelog
| Version | Description |
|---|---|
| 5.7.0 | Deprecated. Use wp_add_privacy_policy_content() instead. |
| 5.0.0 | Added the $strings, $description, and $blocks parameters. |
| 4.9.6 | Introduced. |