WordPress.org

Make WordPress Core

Ticket #43693: 43693.diff

File 43693.diff, 896 bytes (added by spacedmonkey, 21 months ago)
  • src/wp-includes/user.php

     
    882882        if ( ! $site_id ) {
    883883                $site_id = get_current_blog_id();
    884884        }
     885
     886        /**
     887         * Filter the user count before queries are run
     888         *
     889         * @since 5.0.0
     890         *
     891         * @param null|string $result Default null.
     892         * @param string $strategy Optional. The computational strategy to use when counting the users.
     893         *                           Accepts either 'time' or 'memory'. Default 'time'.
     894         * @param int|null $site_id Optional. The site ID to count users for. Defaults to the current site.
     895         */
     896        $pre = apply_filters( 'pre_count_users', null, $strategy, $site_id );
     897
     898        if ( null !== $pre ) {
     899                return $pre;
     900        }
     901
    885902        $blog_prefix = $wpdb->get_blog_prefix( $site_id );
    886903        $result      = array();
    887904