wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi
wp_set_post_lock › WordPress Function
Da2.5.0
Deprecaton/a
› wp_set_post_lock ( $post )
Parametri: |
|
Ritorna: |
|
Definito a: |
|
Codex: |
Marks the post as currently being edited by the current user.
Funzioni correlate: wp_check_post_lock, wp_set_post_cats, wp_refresh_post_lock, wp_get_first_block, wp_get_post_cats
Sorgenti
function wp_set_post_lock( $post ) { $post = get_post( $post ); if ( ! $post ) { return false; } $user_id = get_current_user_id(); if ( 0 == $user_id ) { return false; } $now = time(); $lock = "$now:$user_id"; update_post_meta( $post->ID, '_edit_lock', $lock ); return array( $now, $user_id ); }