override_post_lock хук-фильтрWP 3.6.0

Filters whether to allow the post lock to be overridden.

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

Использование

add_filter( 'override_post_lock', 'wp_kama_override_post_lock_filter', 10, 3 );

/**
 * Function for `override_post_lock` filter-hook.
 * 
 * @param bool    $override Whether to allow the post lock to be overridden.
 * @param WP_Post $post     Post object.
 * @param WP_User $user     The user with the lock for the post.
 *
 * @return bool
 */
function wp_kama_override_post_lock_filter( $override, $post, $user ){

	// filter...
	return $override;
}
$override(true|false)
Whether to allow the post lock to be overridden.
По умолчанию: true
$post(WP_Post)
Post object.
$user(WP_User)
The user with the lock for the post.

Список изменений

С версии 3.6.0 Введена.

Где вызывается хук

_admin_notice_post_locked()
override_post_lock
wp-admin/includes/post.php 1791
$override = apply_filters( 'override_post_lock', true, $post, $user );

Где используется хук в WordPress

Использование не найдено.