Make WordPress Core


Ignore:
Timestamp:
09/05/2010 09:26:27 PM (14 years ago)
Author:
scribu
Message:

introduce WP_List_Table::views(). See #14579

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/users.php

    r15576 r15578  
    360360</h2>
    361361
    362 <div class="filter">
    363 <form id="list-filter" action="" method="get">
    364 <ul class="subsubsub">
    365 <?php
    366 $users_of_blog = count_users();
    367 $total_users = $users_of_blog['total_users'];
    368 $avail_roles =& $users_of_blog['avail_roles'];
    369 unset($users_of_blog);
    370 
    371 $current_role = false;
    372 $class = empty($role) ? ' class="current"' : '';
    373 $role_links = array();
    374 $role_links[] = "<li><a href='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>';
    375 foreach ( $wp_roles->get_names() as $this_role => $name ) {
    376     if ( !isset($avail_roles[$this_role]) )
    377         continue;
    378 
    379     $class = '';
    380 
    381     if ( $this_role == $role ) {
    382         $current_role = $role;
    383         $class = ' class="current"';
    384     }
    385 
    386     $name = translate_user_role( $name );
    387     /* translators: User role name with count */
    388     $name = sprintf( __('%1$s <span class="count">(%2$s)</span>'), $name, $avail_roles[$this_role] );
    389     $role_links[] = "<li><a href='users.php?role=$this_role'$class>$name</a>";
    390 }
    391 echo implode( " |</li>\n", $role_links) . '</li>';
    392 unset($role_links);
    393 ?>
    394 </ul>
    395 </form>
    396 </div>
     362<?php $wp_list_table->views(); ?>
    397363
    398364<form class="search-form" action="" method="get">
Note: See TracChangeset for help on using the changeset viewer.