Summery Summery

Filter the user count before queries are run. Return a non-null value to cause count_users() to return early.

Syntax Syntax

apply_filters( 'pre_count_users', null|string $result, string $strategy, int|null $site_id )

Parameters Parameters


(null|string) The value to return instead. Default null to continue with the query.


(string) The computational strategy to use when counting the users. Accepts either 'time' or 'memory'. Default 'time'.


(int|null) The site ID to count users for. Defaults to the current site.

Source Source

File: wp-includes/user.php


Changelog Changelog

Version Description
5.1.0 Introduced.


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

What are you looking for?