override_post_lock
Filters whether to allow the post lock to be overridden.
Description
Returning a falsey value to the filter will disable the ability to override the post lock.
Parameters (3)
- 0. $true (bool) =>
true
- Whether to allow overriding post locks. Default true.
- 1. $post (WP_Post)
- Post object.
- 2. $user (WP_User)
- User object.
Usage
- To run the hook, copy the example below.
- $true = apply_filters( 'override_post_lock', $true, $post, $user );
- if ( !empty( $true ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the override_post_lock callback
- function filter_override_post_lock( $true, $post, $user ) {
- // make filter magic happen here...
- return $true;
- };
- // add the filter
- add_filter( 'override_post_lock', 'filter_override_post_lock', 10, 3 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'override_post_lock', 'filter_override_post_lock', 10, 3 );
Defined (1)
The filter is defined in the following location(s).
- /wp-admin/includes/post.php
- $override = apply_filters( 'override_post_lock', true, $post, $user );