wp_is_large_network example

$paged = $this->get_pagenum();

        $args = array(
            'number'  => $users_per_page,
            'offset'  => ( $paged - 1 ) * $users_per_page,
            'search'  => $usersearch,
            'blog_id' => 0,
            'fields'  => 'all_with_meta',
        );

        if ( wp_is_large_network( 'users' ) ) {
            $args['search'] = ltrim( $args['search'], '*' );
        } elseif ( '' !== $args['search'] ) {
            $args['search'] = trim( $args['search'], '*' );
            $args['search'] = '*' . $args['search'] . '*';
        }

        if ( 'super' === $role ) {
            $args['login__in'] = get_super_admins();
        }

        /* * If the network is large and a search is not being performed, * show only the latest users with no paging in order to avoid * expensive count queries. */
$parent_file  = 'sites.php';
$submenu_file = 'sites.php';

/** * Filters whether to show the Add Existing User form on the Multisite Users screen. * * @since 3.1.0 * * @param bool $bool Whether to show the Add Existing User form. Default true. */
if ( ! wp_is_large_network( 'users' ) && apply_filters( 'show_network_site_users_add_existing_form', true ) ) {
    wp_enqueue_script( 'user-suggest' );
}

require_once ABSPATH . 'wp-admin/admin-header.php';
?> <script type="text/javascript"> var current_site_id = <?php echo absint( $id ); ?>; </script> <div class="wrap"> <h1 id="edit-site">
wp_enqueue_script( 'wp-ajax-response' );
wp_enqueue_script( 'user-profile' );

/** * Filters whether to enable user auto-complete for non-super admins in Multisite. * * @since 3.4.0 * * @param bool $enable Whether to enable auto-complete for non-super admins. Default false. */
if ( is_multisite() && current_user_can( 'promote_users' ) && ! wp_is_large_network( 'users' )
    && ( current_user_can( 'manage_network_users' ) || apply_filters( 'autocomplete_users_for_site_admins', false ) )
) {
    wp_enqueue_script( 'user-suggest' );
}

require_once ABSPATH . 'wp-admin/admin-header.php';

if ( isset( $_GET['update'] ) ) {
    $messages = array();
    if ( is_multisite() ) {
        $edit_link = '';
        

function wp_get_sites( $args = array() ) {
    _deprecated_function( __FUNCTION__, '4.6.0', 'get_sites()' );

    if ( wp_is_large_network() )
        return array();

    $defaults = array(
        'network_id' => get_current_network_id(),
        'public'     => null,
        'archived'   => null,
        'mature'     => null,
        'spam'       => null,
        'deleted'    => null,
        'limit'      => 100,
        'offset'     => 0,
    );
$s    = isset( $_REQUEST['s'] ) ? wp_unslash( trim( $_REQUEST['s'] ) ) : '';
        $wild = '';
        if ( str_contains( $s, '*' ) ) {
            $wild = '*';
            $s    = trim( $s, '*' );
        }

        /* * If the network is large and a search is not being performed, show only * the latest sites with no paging in order to avoid expensive count queries. */
        if ( ! $s && wp_is_large_network() ) {
            if ( ! isset( $_REQUEST['orderby'] ) ) {
                $_GET['orderby']     = '';
                $_REQUEST['orderby'] = '';
            }
            if ( ! isset( $_REQUEST['order'] ) ) {
                $_GET['order']     = 'DESC';
                $_REQUEST['order'] = 'DESC';
            }
        }

        $args = array(
            
function wp_ajax_oembed_cache() {
    $GLOBALS['wp_embed']->cache_oembed( $_GET['post'] );
    wp_die( 0 );
}

/** * Handles user autocomplete via AJAX. * * @since 3.4.0 */
function wp_ajax_autocomplete_user() {
    if ( ! is_multisite() || ! current_user_can( 'promote_users' ) || wp_is_large_network( 'users' ) ) {
        wp_die( -1 );
    }

    /** This filter is documented in wp-admin/user-new.php */
    if ( ! current_user_can( 'manage_network_users' ) && ! apply_filters( 'autocomplete_users_for_site_admins', false ) ) {
        wp_die( -1 );
    }

    $return = array();

    /* * Check the type of request. * Current allowed values are `add` and `search`. */


            $search_columns = array();
            if ( $qv['search_columns'] ) {
                $search_columns = array_intersect( $qv['search_columns'], array( 'ID', 'user_login', 'user_email', 'user_url', 'user_nicename', 'display_name' ) );
            }
            if ( ! $search_columns ) {
                if ( str_contains( $search, '@' ) ) {
                    $search_columns = array( 'user_email' );
                } elseif ( is_numeric( $search ) ) {
                    $search_columns = array( 'user_login', 'ID' );
                } elseif ( preg_match( '|^https?://|', $search ) && ! ( is_multisite() && wp_is_large_network( 'users' ) ) ) {
                    $search_columns = array( 'user_url' );
                } else {
                    $search_columns = array( 'user_login', 'user_url', 'user_email', 'user_nicename', 'display_name' );
                }
            }

            /** * Filters the columns to search in a WP_User_Query search. * * The default columns depend on the search term, and include 'ID', 'user_login', * 'user_email', 'user_url', 'user_nicename', and 'display_name'. * * @since 3.6.0 * * @param string[] $search_columns Array of column names to be searched. * @param string $search Text being searched. * @param WP_User_Query $query The current WP_User_Query instance. */

function wp_maybe_update_network_site_counts( $network_id = null ) {
    $is_small_network = ! wp_is_large_network( 'sites', $network_id );

    /** * Filters whether to update network site or user counts when a new site is created. * * @since 3.7.0 * * @see wp_is_large_network() * * @param bool $small_network Whether the network is considered small. * @param string $context Context. Either 'users' or 'sites'. */
    
Home | Imprint | This part of the site doesn't use cookies.