show_post_locked_dialog
Filters whether to show the post locked dialog.
Returning false from the filter will prevent the dialog from being displayed.
Использование
add_filter( 'show_post_locked_dialog', 'wp_kama_show_post_locked_dialog_filter', 10, 3 ); /** * Function for `show_post_locked_dialog` filter-hook. * * @param bool $display Whether to display the dialog. * @param WP_Post $post Post object. * @param WP_User $user The user with the lock for the post. * * @return bool */ function wp_kama_show_post_locked_dialog_filter( $display, $post, $user ){ // filter... return $display; }
- $display(true|false)
- Whether to display the dialog.
По умолчанию: true - $post(WP_Post)
- Post object.
- $user(WP_User)
- The user with the lock for the post.
Список изменений
С версии 3.6.0 | Введена. |
Где вызывается хук
wp-admin/includes/post.php 1798
if ( ! apply_filters( 'show_post_locked_dialog', true, $post, $user ) ) {
wp-admin/edit-form-blocks.php 178
if ( apply_filters( 'show_post_locked_dialog', true, $post, $user_id ) ) {