insert_user_meta

過濾鉤子
apply_filters( 'insert_user_meta', $meta, $user, $update, $userdata )
引數
  • (array) $meta { Default meta values and keys for the user. @type string $nickname The user's nickname. Default is the user's username. @type string $first_name The user's first name. @type string $last_name The user's last name. @type string $description The user's description. @type string $rich_editing Whether to enable the rich-editor for the user. Default 'true'. @type string $syntax_highlighting Whether to enable the rich code editor for the user. Default 'true'. @type string $comment_shortcuts Whether to enable keyboard shortcuts for the user. Default 'false'. @type string $admin_color The color scheme for a user's admin screen. Default 'fresh'. @type int|bool $use_ssl Whether to force SSL on the user's admin area. 0|false if SSL is not forced. @type string $show_admin_bar_front Whether to show the admin bar on the front end for the user. Default 'true'. @type string $locale User's locale. Default empty. }
    Required:
  • (WP_User) $user User object.
    Required:
  • (bool) $update Whether the user is being updated rather than created.
    Required:
  • (array) $userdata The raw array of data passed to wp_insert_user().
    Required:
定義位置
相關勾子
insert_custom_user_metawp_pre_insert_user_datasignup_user_metawp_insert_term_datarest_insert_user
相關方法
get_user_metaget_usermetadelete_user_metawp_insert_userregister_term_metadelete_usermeta
引入
5.8.0
棄用
-

insert_user_meta。這個鉤子允許你在WordPress資料庫中插入使用者後設資料。你可以使用這個鉤子來儲存使用者後設資料,如使用者偏好或自定義使用者欄位。

在建立或更新使用者之後以及插入或更新任何使用者元之前,立即過濾使用者的元值和鍵。

不包括接觸方法。這些是使用wp_get_user_contact_methods($user)新增的。

對於自定義元欄位,請參見 {@see‘insert_custom_user_meta‘} 過濾器。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$meta = apply_filters( 'insert_user_meta', $meta, $user, $update, $userdata );
$meta = apply_filters( 'insert_user_meta', $meta, $user, $update, $userdata );
$meta = apply_filters( 'insert_user_meta', $meta, $user, $update, $userdata );

常見問題

FAQs
檢視更多 >