wp_check_post_lock [ WordPress Function ]
wp_check_post_lock ( $post_id )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Benzer Fonksiyonlar: wp_set_post_lock, wp_check_password, wp_get_post_cats, wp_set_post_cats, wp_check_post_hierarchy_for_loops
Check to see if the post is currently being edited by another user.
Source
<?php
function wp_check_post_lock( $post_id ) {
if ( !$post = get_post( $post_id ) )
return false;
if ( !$lock = get_post_meta( $post->ID, '_edit_lock', true ) )
return false;
$lock = explode( ':', $lock );
$time = $lock[0];
$user = isset( $lock[1] ) ? $lock[1] : get_post_meta( $post->ID, '_edit_last', true );
$time_window = apply_filters( 'wp_check_post_lock_window', AUTOSAVE_INTERVAL * 2 );
if ( $time && $time > time() - $time_window && $user != get_current_user_id() )
return $user;
return false;
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- wp_check_post_lock (WordPress Function) - WPSeek.com
WordPress lookup for wp_check_post_lock, a WordPress Function. wpseek.com is a WordPress-centric search tool for developers and theme authors.
wpseek.com - Lock post editing to one user at a time - wp_check_post_lock
Apr 23, 2012 ... I am creating a website where user have to be logged in to give a price bid on a product. Only one bid can be given on the product. Therefore ...
wordpress.stackexchange.com - #6043 (Post Edit Collision Detection) – WordPress Trac
New function: wp_check_post_lock() checks to see if a post is locked and by ... When someone else goes to edit that post, if wp_check_post_lock(), display ...
core.trac.wordpress.org - Ticket #15130 - WordPress Trac
When a user opens a post for editing the editor calls wp_check_post_lock which ... and wp_check_post_lock needs to be changed to reference this variable.
core.trac.wordpress.org