wp_is_large_user_count example

_doing_it_wrong(
            __FUNCTION__,
            sprintf(
                /* translators: %s: $network_id */
                __( 'Unable to pass %s if not using multisite.' ),
                '<code>$network_id</code>'
            ),
            '6.0.0'
        );
    }

    $is_small_network = ! wp_is_large_user_count( $network_id );
    /** This filter is documented in wp-includes/ms-functions.php */
    if ( ! apply_filters( 'enable_live_network_counts', $is_small_network, 'users' ) ) {
        return false;
    }

    return wp_update_user_counts( $network_id );
}

/** * Updates the total count of users on the site. * * @global wpdb $wpdb WordPress database abstraction object. * @since 6.0.0 * * @param int|null $network_id ID of the network. Defaults to the current network. * @return bool Whether the update was successful. */

    protected function get_views() {
        global $role;

        $wp_roles = wp_roles();

        $count_users = ! wp_is_large_user_count();

        if ( $this->is_site_users ) {
            $url = 'site-users.php?id=' . $this->site_id;
        } else {
            $url = 'users.php';
        }

        $role_links  = array();
        $avail_roles = array();
        $all_text    = __( 'All' );

        
</fieldset> <br class="clear" /> <?php endif; // $bulk ?> <?php                 if ( post_type_supports( $screen->post_type, 'author' ) ) {
                    $authors_dropdown = '';

                    if ( current_user_can( $post_type_object->cap->edit_others_posts ) ) {
                        $dropdown_name  = 'post_author';
                        $dropdown_class = 'authors';
                        if ( wp_is_large_user_count() ) {
                            $authors_dropdown = sprintf( '<select name="%s" class="%s hidden"></select>', esc_attr( $dropdown_name )esc_attr( $dropdown_class ) );
                        } else {
                            $users_opt = array(
                                'hide_if_only_one_author' => false,
                                'capability'              => array( $post_type_object->cap->edit_posts ),
                                'name'                    => $dropdown_name,
                                'class'                   => $dropdown_class,
                                'multi'                   => 1,
                                'echo'                    => 0,
                                'show'                    => 'display_name_with_login',
                            );

                            

function wp_is_large_network( $using = 'sites', $network_id = null ) {
    $network_id = (int) $network_id;
    if ( ! $network_id ) {
        $network_id = get_current_network_id();
    }

    if ( 'users' === $using ) {
        $count = get_user_count( $network_id );

        $is_large_network = wp_is_large_user_count( $network_id );

        /** * Filters whether the network is considered large. * * @since 3.3.0 * @since 4.8.0 The `$network_id` parameter has been added. * * @param bool $is_large_network Whether the network has more than 10000 users or sites. * @param string $component The component to count. Accepts 'users', or 'sites'. * @param int $count The count of items for the component. * @param int $network_id The ID of the network being checked. */
Home | Imprint | This part of the site doesn't use cookies.