WP_Customize_Manager::refresh_changeset_lock( int $changeset_post_id )
- Since
- 4.9.0
- Source
wp-includes/class-wp-customize-manager.php:3280
Refreshes changeset lock with the current time if current user edited the changeset before.
Parameters
$changeset_post_idint- Changeset post ID.
Uses · 3
- get_post_meta()Retrieves a post meta field for the given post ID.
- get_current_user_id()Gets the current user's ID.
- update_post_meta()Updates a post meta field based on the given post ID.
Used by · 2
- WP_Customize_Manager::check_changeset_lock_with_heartbeat()Checks locked changeset with heartbeat API.
- WP_Customize_Manager::set_changeset_lock()Marks the changeset post as being currently edited by the current user.
Source
public function refresh_changeset_lock( $changeset_post_id ) { if ( ! $changeset_post_id ) { return; } $lock = get_post_meta( $changeset_post_id, '_edit_lock', true ); $lock = explode( ':', $lock ); if ( $lock && ! empty( $lock[1] ) ) { $user_id = (int) $lock[1]; $current_user_id = get_current_user_id(); if ( $user_id === $current_user_id ) { $lock = sprintf( '%s:%s', time(), $user_id ); update_post_meta( $changeset_post_id, '_edit_lock', $lock ); } } }History
Introduced in 4.9.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 6.7.7 tag, from
src/wp-includes/class-wp-customize-manager.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.