GC_Customize_Manager::get_lock_user_data()

最后更新于:2021-11-27 00:57:48

GC_Customize_Manager::get_lock_user_data( int$user_id)

Get lock user data.

参数

$user_id

(int) (Required) User ID.

响应

(array|null) User data formatted for client.

源文件

文件: gc-includes/class-gc-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 ) ),
		);
	}