WP_Customize_Manager::set_changeset_lock()
Marks the changeset post as being currently edited by the current user.
Метод класса: WP_Customize_Manager{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
$WP_Customize_Manager = new WP_Customize_Manager(); $WP_Customize_Manager->set_changeset_lock( $changeset_post_id, $take_over );
- $changeset_post_id(int) (обязательный)
- Changeset post ID.
- $take_over(true|false)
- Whether to take over the changeset.
По умолчанию: false
Список изменений
С версии 4.9.0 | Введена. |
Код WP_Customize_Manager::set_changeset_lock() WP Customize Manager::set changeset lock WP 6.6.1
public function set_changeset_lock( $changeset_post_id, $take_over = false ) { if ( $changeset_post_id ) { $can_override = ! (bool) get_post_meta( $changeset_post_id, '_edit_lock', true ); if ( $take_over ) { $can_override = true; } if ( $can_override ) { $lock = sprintf( '%s:%s', time(), get_current_user_id() ); update_post_meta( $changeset_post_id, '_edit_lock', $lock ); } else { $this->refresh_changeset_lock( $changeset_post_id ); } } }