wp_pre_insert_user_data

過濾鉤子
apply_filters( 'wp_pre_insert_user_data', $data, $update, ( $update ? $user_id : null )
引數
  • (array) $data { Values and keys for the user. @type string $user_login The user's login. Only included if $update == false @type string $user_pass The user's password. @type string $user_email The user's email. @type string $user_url The user's url. @type string $user_nicename The user's nice name. Defaults to a URL-safe version of user's login @type string $display_name The user's display name. @type string $user_registered MySQL timestamp describing the moment when the user registered. Defaults to the current UTC timestamp. }
    Required:
  • (bool) $update Whether the user is being updated rather than created.
    Required:
  • (int|null) $user_id ID of the user to be updated, or NULL if the user is being created.
    Required:
  • (array) $userdata The raw array of data passed to wp_insert_user().
    Required:
定義位置
相關勾子
wp_insert_term_datarest_pre_insert_userinsert_user_metarest_insert_userpre_insert_term
相關方法
wp_insert_userwp_reset_postdatawp_print_script_tagwp_reset_querywp_insert_termwp_insert_site
引入
5.8.0
棄用
-

wp_pre_insert_user_data: 這是一個使用者資料插入前的過濾器。使用此過濾器可以在儲存使用者資料之前對其進行修改,以確儲存儲的資料是正確的。

在建立或更新記錄之前過濾使用者資料。

它只包括使用者表中的資料,不包括任何使用者後設資料。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$data = apply_filters( 'wp_pre_insert_user_data', $data, $update, ( $update ? $user_id : null ), $userdata );
$data = apply_filters( 'wp_pre_insert_user_data', $data, $update, ( $update ? $user_id : null ), $userdata );
$data = apply_filters( 'wp_pre_insert_user_data', $data, $update, ( $update ? $user_id : null ), $userdata );

常見問題

FAQs
檢視更多 >