钩子文档

xmlrpc_call_success_mw_newPost

💡 云策文档标注

概述

此 Hook 在通过 XML-RPC MovableType API 成功创建新文章后触发,用于在文章创建后执行自定义操作。

关键要点

  • 触发时机:在 XML-RPC MovableType API 的 mw_newPost 方法成功创建新文章后立即执行。
  • 参数:$post_id(新文章的 ID,整数类型)和 $args(创建新文章的参数数组)。
  • 相关函数:与 wp_xmlrpc_server::mw_newPost() 方法关联,该方法位于 wp-includes/class-wp-xmlrpc-server.php 文件中。
  • 版本历史:自 WordPress 3.4.0 版本引入。

代码示例

do_action( 'xmlrpc_call_success_mw_newPost', $post_id, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase

📄 原文内容

Fires after a new post has been successfully created via the XML-RPC MovableType API.

Parameters

$post_idint
ID of the new post.
$argsarray
An array of arguments to create the new post.

Source

do_action( 'xmlrpc_call_success_mw_newPost', $post_id, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase

Changelog

Version Description
3.4.0 Introduced.