钩子文档

post_submitbox_start

💡 云策文档标注

概述

post_submitbox_start 是一个 WordPress 动作钩子,在发布元框的发布操作部分开始时触发。它允许开发者在编辑文章或链接时添加自定义内容或功能。

关键要点

  • 触发时机:在发布元框的发布操作部分开始时执行。
  • 参数:$post,类型为 WP_Post|null,在编辑文章屏幕时为当前文章的 WP_Post 对象,在编辑链接屏幕时为 null。
  • 用法:通过 do_action('post_submitbox_start', $post) 调用。
  • 相关函数:link_submit_meta_box() 和 post_submit_meta_box() 用于显示表单字段。
  • 版本历史:从 WordPress 2.7.0 引入,4.9.0 版本添加了 $post 参数。

📄 原文内容

Fires at the beginning of the publishing actions section of the Publish meta box.

Parameters

$postWP_Post|null
WP_Post object for the current post on Edit Post screen, null on Edit Link screen.

Source

do_action( 'post_submitbox_start', $post );

Changelog

Version Description
4.9.0 Added the $post parameter.
2.7.0 Introduced.