pre_count_users

過濾鉤子
apply_filters( 'pre_count_users', null, $strategy, $site_id )
引數
  • (null|array) $result The value to return instead. Default null to continue with the query.
    Required:
  • (string) $strategy Optional. The computational strategy to use when counting the users. Accepts either 'time' or 'memory'. Default 'time'.
    Required:
  • (int) $site_id The site ID to count users for.
    Required:
定義位置
相關勾子
pre_comment_user_ipset_current_userpre_comment_user_agentrest_comment_queryrest_insert_user
相關方法
count_userswp_count_termswp_count_siteswp_get_current_usercount_user_postswp_set_current_user
引入
5.1.0
棄用
-

pre_count_users: 這是一個過濾鉤子,允許修改傳遞給count_users函式的引數。該鉤子在count_users函式被呼叫之前被觸發,並將引數作為一個引數傳遞。這個鉤子可以用來修改傳遞給函式的引數,例如,在查詢中新增額外的標準。

在執行查詢前過濾使用者數。
返回一個非空值,使count_users()提前返回。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$pre = apply_filters( 'pre_count_users', null, $strategy, $site_id );
$pre = apply_filters( 'pre_count_users', null, $strategy, $site_id );
$pre = apply_filters( 'pre_count_users', null, $strategy, $site_id );

常見問題

FAQs
檢視更多 >