Title: override_post_lock
Published: April 25, 2014
Last modified: May 20, 2026

---

# apply_filters( ‘override_post_lock’, bool $override, WP_Post $post, WP_User $user )

## In this article

 * [Description](https://developer.wordpress.org/reference/hooks/override_post_lock/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/hooks/override_post_lock/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/override_post_lock/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/override_post_lock/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/override_post_lock/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/hooks/override_post_lock/?output_format=md#wp--skip-link--target)

Filters whether to allow the post lock to be overridden.

## 󠀁[Description](https://developer.wordpress.org/reference/hooks/override_post_lock/?output_format=md#description)󠁿

Returning false from the filter will disable the ability to override the post lock.

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/override_post_lock/?output_format=md#parameters)󠁿

 `$override`bool

Whether to allow the post lock to be overridden. Default true.

`$post`[WP_Post](https://developer.wordpress.org/reference/classes/wp_post/)

Post object.

`$user`[WP_User](https://developer.wordpress.org/reference/classes/wp_user/)

The user with the lock for the post.

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/override_post_lock/?output_format=md#source)󠁿

    ```php
    $override = apply_filters( 'override_post_lock', true, $post, $user );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/post.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-admin/includes/post.php#L1871)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-admin/includes/post.php#L1871-L1871)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/override_post_lock/?output_format=md#related)󠁿

| Used by | Description | 
| [_admin_notice_post_locked()](https://developer.wordpress.org/reference/functions/_admin_notice_post_locked/)`wp-admin/includes/post.php` |

Outputs the HTML for the notice to say that someone else is editing or has taken over editing of this post.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/override_post_lock/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Foverride_post_lock%2F)
before being able to contribute a note or feedback.