post_type )->public ) {
if ( 'publish' === $post->post_status || $user->ID != $post->post_author ) {
// Latest content is in autosave.
$nonce = wp_create_nonce( 'post_preview_' . $post->ID );
$query_args['preview_id'] = $post->ID;
$query_args['preview_nonce'] = $nonce;
}
}
$preview_link = get_preview_post_link( $post->ID, $query_args );
/**
* Filters whether to allow the post lock to be overridden.
*
* Returning false from the filter will disable the ability
* to override the post lock.
*
* @since 3.6.0
*
* @param bool $override Whether to allow the post lock to be overridden. Default true.
* @param WP_Post $post Post object.
* @param WP_User $user The user with the lock for the post.
*/
$override = apply_filters( 'override_post_lock', true, $post, $user );
$tab_last = $override ? '' : ' wp-tab-last';
?>
ID, 64 ); ?>
display_name ) );
} else {
/* translators: %s: User's display name. */
printf( __( '%s is currently editing this post.' ), esc_html( $user->display_name ) );
}
?>