钩子文档

xmlrpc_prepare_comment

💡 云策文档标注

概述

xmlrpc_prepare_comment 是一个 WordPress 过滤器,用于在 XML-RPC 接口中处理评论数据。它允许开发者修改或扩展为 XML-RPC 准备的评论数据数组。

关键要点

  • 这是一个过滤器 Hook,名称为 xmlrpc_prepare_comment。
  • 它接收两个参数:$_comment(一个包含准备数据的数组)和 $comment(一个 WP_Comment 对象)。
  • 主要用于 wp_xmlrpc_server::_prepare_comment() 方法中,以准备评论数据用于 XML-RPC 对象返回。
  • 自 WordPress 3.4.0 版本引入。

📄 原文内容

Filters XML-RPC-prepared data for the given comment.

Parameters

$_commentarray
An array of prepared comment data.
$commentWP_Comment
Comment object.

Source

return apply_filters( 'xmlrpc_prepare_comment', $_comment, $comment );

Changelog

Version Description
3.4.0 Introduced.