WP_Customize_Manager::get_lock_user_data() WordPress Method

The WP_Customize_Manager::get_lock_user_data() method is used to retrieve the lock user data for the current Customizer session. This data includes the user ID, the user name, and the user URL.

WP_Customize_Manager::get_lock_user_data( int $user_id ) #

Gets lock user data.


Parameters

$user_id

(int)(Required)User ID.


Top ↑

Return

(array|null) User data formatted for client.


Top ↑

Source

File: wp-includes/class-wp-customize-manager.php

	protected function get_lock_user_data( $user_id ) {
		if ( ! $user_id ) {
			return null;
		}

		$lock_user = get_userdata( $user_id );

		if ( ! $lock_user ) {
			return null;
		}

		return array(
			'id'     => $lock_user->ID,
			'name'   => $lock_user->display_name,
			'avatar' => get_avatar_url( $lock_user->ID, array( 'size' => 128 ) ),
		);
	}


Top ↑

Changelog

Changelog
VersionDescription
4.9.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More