钩子文档

show_post_locked_dialog

💡 云策文档标注

概述

show_post_locked_dialog 是一个 WordPress 过滤器,用于控制是否显示文章锁定对话框。开发者可以通过此过滤器自定义对话框的显示逻辑。

关键要点

  • 过滤器名称:show_post_locked_dialog
  • 作用:过滤是否显示文章锁定对话框,返回 false 可阻止显示
  • 参数:$display(布尔值,默认 true)、$post(WP_Post 对象)、$user(WP_User 对象)
  • 引入版本:WordPress 3.6.0
  • 相关函数:_admin_notice_post_locked() 用于输出锁定通知的 HTML

📄 原文内容

Filters whether to show the post locked dialog.

Description

Returning false from the filter will prevent the dialog from being displayed.

Parameters

$displaybool
Whether to display the dialog. Default true.
$postWP_Post
Post object.
$userWP_User
The user with the lock for the post.

Source

if ( ! apply_filters( 'show_post_locked_dialog', true, $post, $user ) ) {

Changelog

Version Description
3.6.0 Introduced.