钩子文档

wxr_export_skip_commentmeta

💡 云策文档标注

概述

wxr_export_skip_commentmeta 是一个 WordPress 过滤器,用于在 WXR 导出过程中选择性跳过评论元数据。开发者可以通过此过滤器控制是否导出特定的评论元对象。

关键要点

  • 过滤器名称:wxr_export_skip_commentmeta
  • 用途:在生成 WXR 导出文件时,跳过指定的评论元数据
  • 参数:$skip(布尔值,默认 false)、$meta_key(字符串)、$meta(对象)
  • 返回值:返回真值(truthy)将跳过当前元对象导出
  • 引入版本:WordPress 4.0.0
  • 相关函数:export_wp() 用于生成 WXR 导出文件

代码示例

if ( apply_filters( 'wxr_export_skip_commentmeta', false, $meta->meta_key, $meta ) ) {
    // 跳过当前评论元数据的导出逻辑
}

📄 原文内容

Filters whether to selectively skip comment meta used for WXR exports.

Description

Returning a truthy value from the filter will skip the current meta object from being exported.

Parameters

$skipbool
Whether to skip the current comment meta. Default false.
$meta_keystring
Current meta key.
$metaobject
Current meta object.

Source

if ( apply_filters( 'wxr_export_skip_commentmeta', false, $meta->meta_key, $meta ) ) {

Changelog

Version Description
4.0.0 Introduced.