_get_additional_user_keys

函式
_get_additional_user_keys ( $user )
Access
Private
引數
  • (WP_User) $user WP_User instance.
    Required:
返回值
  • (string[]) List of user keys to be populated in wp_update_user().
定義位置
相關方法
get_editable_user_idswp_get_additional_image_sizesget_edit_user_linkget_author_user_idsget_editable_roles
引入
3.3.0
棄用
-

_get_additional_user_keys: 這是一個用來獲取額外的使用者元欄位的函式,這些欄位不屬於WordPress中預設的使用者元欄位集合。它接受一個使用者ID作為引數,並返回一個額外的使用者元欄位的陣列。

返回一個元鍵的列表,以便在wp_update_user()中(可能)填充。

通過這個函式返回的鍵值列表取決於要設定的使用者後設資料中是否有這些鍵值。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function _get_additional_user_keys( $user ) {
$keys = array( 'first_name', 'last_name', 'nickname', 'description', 'rich_editing', 'syntax_highlighting', 'comment_shortcuts', 'admin_color', 'use_ssl', 'show_admin_bar_front', 'locale' );
return array_merge( $keys, array_keys( wp_get_user_contact_methods( $user ) ) );
}
function _get_additional_user_keys( $user ) { $keys = array( 'first_name', 'last_name', 'nickname', 'description', 'rich_editing', 'syntax_highlighting', 'comment_shortcuts', 'admin_color', 'use_ssl', 'show_admin_bar_front', 'locale' ); return array_merge( $keys, array_keys( wp_get_user_contact_methods( $user ) ) ); }
function _get_additional_user_keys( $user ) {
	$keys = array( 'first_name', 'last_name', 'nickname', 'description', 'rich_editing', 'syntax_highlighting', 'comment_shortcuts', 'admin_color', 'use_ssl', 'show_admin_bar_front', 'locale' );
	return array_merge( $keys, array_keys( wp_get_user_contact_methods( $user ) ) );
}

常見問題

FAQs
檢視更多 >