钩子文档

add_inline_data

💡 云策文档标注

概述

add_inline_data 是一个 WordPress 动作钩子,在输出文章和页面的内联编辑器字段后触发,用于添加隐藏数据字段。

关键要点

  • 触发时机:在输出文章和页面的内联编辑器字段后执行。
  • 参数:接受 $post(当前文章对象)和 $post_type_object(当前文章类型对象)作为参数。
  • 用途:主要用于添加隐藏字段,以支持内联编辑器的数据操作。
  • 相关函数:与 get_inline_data() 函数关联,用于生成内联编辑器所需的数据。
  • 版本历史:从 WordPress 4.9.8 版本开始引入。

📄 原文内容

Fires after outputting the fields for the inline editor for posts and pages.

Parameters

$postWP_Post
The current post object.
$post_type_objectWP_Post_Type
The current post’s post type object.

Source

do_action( 'add_inline_data', $post, $post_type_object );

Changelog

Version Description
4.9.8 Introduced.