Marks the post as currently being edited by the current user.
Parameters
$post
int|WP_Postrequired- ID or object of the post being edited.
Source
* @since 2.5.0
*
* @param int|WP_Post $post ID or object of the post being edited.
* @return array|false {
* Array of the lock time and user ID. False if the post does not exist, or there
* is no current user.
*
* @type int $0 The current time as a Unix timestamp.
* @type int $1 The ID of the current user.
* }
*/
function wp_set_post_lock( $post ) {
$post = get_post( $post );
if ( ! $post ) {
return false;
}
$user_id = get_current_user_id();
Changelog
Version | Description |
---|---|
2.5.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.