コード例 #1
0
 /**
  * Renders the list table views.
  *
  * @since 1.0.0
  * @access public
  *
  * @global string $role
  *
  * @return array
  */
 protected function get_views()
 {
     global $role;
     $total_users = get_global_user_count();
     //TODO: support view for global administrators
     $global_admins = array();
     $total_admins = count($global_admins);
     $class = $role != 'super' ? ' class="current"' : '';
     $role_links = array();
     $role_links['all'] = "<a href='" . global_admin_url('users.php') . "'{$class}>" . sprintf(_nx('All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_users, 'users'), number_format_i18n($total_users)) . '</a>';
     $class = $role === 'super' ? ' class="current"' : '';
     $role_links['super'] = "<a href='" . global_admin_url('users.php?role=super') . "'{$class}>" . sprintf(_n('Super Admin <span class="count">(%s)</span>', 'Super Admins <span class="count">(%s)</span>', $total_admins), number_format_i18n($total_admins)) . '</a>';
     return $role_links;
 }
コード例 #2
0
 function wp_is_large_setup($using = 'sites')
 {
     if ('users' == $using) {
         $count = get_global_user_count();
         /**
          * Filters whether the setup is considered large.
          *
          * @since 1.0.0
          *
          * @param bool   $is_large_setup   Whether the setup 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.
          */
         return apply_filters('wp_is_large_setup', $count > 10000, 'users', $count);
     }
     $count = get_global_site_count();
     /** This filter is documented in wp-includes/ms-functions.php */
     return apply_filters('wp_is_large_setup', $count > 10000, 'sites', $count);
 }