post_locked_dialog
Action HookDescription
Fires inside the post locked dialog before the buttons are displayed.Hook Information
File Location |
wp-admin/includes/post.php
View on GitHub
|
Hook Type | Action |
Line Number | 1895 |
Hook Parameters
Type | Name | Description |
---|---|---|
WP_Post
|
$post
|
Post object. |
WP_User
|
$user
|
The user with the lock for the post. |
Usage Examples
Basic Usage
<?php
// Hook into post_locked_dialog
add_action('post_locked_dialog', 'my_custom_function', 10, 2);
function my_custom_function($post, $user) {
// Your custom code here
}
Source Code Context
wp-admin/includes/post.php:1895
- How this hook is used in WordPress core
<?php
1890 * @since 5.4.0 The $user parameter was added.
1891 *
1892 * @param WP_Post $post Post object.
1893 * @param WP_User $user The user with the lock for the post.
1894 */
1895 do_action( 'post_locked_dialog', $post, $user );
1896 ?>
1897 <p>
1898 <a class="button" href="<?php echo esc_url( $sendback ); ?>"><?php echo $sendback_text; ?></a>
1899 <?php if ( $preview_link ) { ?>
1900 <a class="button<?php echo $tab_last; ?>" href="<?php echo esc_url( $preview_link ); ?>"><?php _e( 'Preview' ); ?></a>
PHP Documentation
<?php
/**
* Fires inside the post locked dialog before the buttons are displayed.
*
* @since 3.6.0
* @since 5.4.0 The $user parameter was added.
*
* @param WP_Post $post Post object.
* @param WP_User $user The user with the lock for the post.
*/
Quick Info
- Hook Type: Action
- Parameters: 2
- File: wp-admin/includes/post.php
Related Hooks
Related hooks will be displayed here in future updates.