xmlrpc_wp_insert_post_data
云策文档标注
概述
xmlrpc_wp_insert_post_data 是一个 WordPress 过滤器,用于在通过 XML-RPC 插入文章时修改文章数据数组。它允许开发者在数据被插入数据库前进行自定义处理。
关键要点
- 这是一个过滤器 Hook,用于处理 XML-RPC 相关的文章插入操作。
- 接受两个参数:$post_data(已解析的文章数据数组)和 $content_struct(原始文章数据数组)。
- 在 wp_xmlrpc_server::_insert_post() 方法中被调用,作为 wp_newPost() 和 wp_editPost() 的共享逻辑部分。
- 自 WordPress 3.4.0 版本引入。
原文内容
Filters post data array to be inserted via XML-RPC.
Parameters
$post_dataarray-
Parsed array of post data.
$content_structarray-
Post data array.
Source
$post_data = apply_filters( 'xmlrpc_wp_insert_post_data', $post_data, $content_struct );
Changelog
| Version | Description |
|---|---|
| 3.4.0 | Introduced. |