determine_current_user

過濾鉤子
apply_filters( 'determine_current_user', false )
引數
  • (int|false) $user_id User ID if one has been determined, false otherwise.
    Required:
定義位置
相關勾子
set_current_userpre_count_usersrest_after_insert_userdetermine_localepre_comment_user_ip
相關方法
set_current_userwp_get_current_userget_current_user_idwp_set_current_user_wp_get_current_userget_current_site
引入
3.9.0
棄用
-

determine_current_user: 這個過濾器是用來確定WordPress中的當前使用者。它通常用於修改使用者資訊或新增自定義使用者角色。

對當前使用者進行過濾。

如果有的話,預設的過濾器會使用它來從請求的 cookie 中確定當前使用者。

返回值為 false 將有效地縮短設定當前使用者的時間。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$user_id = apply_filters( 'determine_current_user', false );
$user_id = apply_filters( 'determine_current_user', false );
$user_id = apply_filters( 'determine_current_user', false );

常見問題

FAQs
檢視更多 >