Changeset 27301
- Timestamp:
- 02/26/2014 10:19:10 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-users-list-table.php
r27077 r27301 3 3 * Users List Table class. 4 4 * 5 * @since 3.1.0 6 * @access private 7 * 5 8 * @package WordPress 6 9 * @subpackage List_Table 7 * @since 3.1.08 * @access private9 10 */ 10 11 class WP_Users_List_Table extends WP_List_Table { 11 12 13 /** 14 * Site ID to generate the Users list table for. 15 * 16 * @since 3.1.0 17 * @access public 18 * @var int 19 */ 12 20 var $site_id; 21 22 /** 23 * Whether or not the current Users list table is for Multisite. 24 * 25 * @since 3.1.0 26 * @access public 27 * @var bool 28 */ 13 29 var $is_site_users; 14 30 31 /** 32 * Constructor. 33 * 34 * @since 3.1.0 35 * @access public 36 */ 15 37 function __construct( $args = array() ) { 16 38 parent::__construct( array( … … 26 48 } 27 49 50 /** 51 * Check the current user's permissions. 52 * 53 * @since 3.1.0 54 * @access public 55 */ 28 56 function ajax_user_can() { 29 57 if ( $this->is_site_users ) … … 33 61 } 34 62 63 /** 64 * Prepare the users list for display. 65 * 66 * @since 3.1.0 67 * @access public 68 */ 35 69 function prepare_items() { 36 70 global $role, $usersearch; … … 76 110 } 77 111 112 /** 113 * Output 'no users' message. 114 * 115 * @since 3.1.0 116 * @access public 117 */ 78 118 function no_items() { 79 119 _e( 'No matching users were found.' ); 80 120 } 81 121 122 /** 123 * Return an associative array listing all the views that can be used 124 * with this table. 125 * 126 * Provides a list of roles and user count for that role for easy 127 * filtering of the user table. 128 * 129 * @since 3.1.0 130 * @access public 131 * 132 * @return array An array of HTML links, one for each view. 133 */ 82 134 function get_views() { 83 135 global $wp_roles, $role; … … 120 172 } 121 173 174 /** 175 * Retrieve an associative array of bulk actions available on this table. 176 * 177 * @since 3.1.0 178 * @access public 179 * 180 * @return array Array of bulk actions. 181 */ 122 182 function get_bulk_actions() { 123 183 $actions = array(); … … 134 194 } 135 195 196 /** 197 * Output the controls to allow user roles to be changed in bulk. 198 * 199 * @since 3.1.0 200 * @access public 201 * 202 * @param string $which Whether this is being invoked above ("top") 203 * or below the table ("bottom"). 204 */ 136 205 function extra_tablenav( $which ) { 137 206 if ( 'top' != $which ) … … 153 222 } 154 223 224 /** 225 * Capture the bulk action required, and return it. 226 * 227 * Overridden from the base class implementation to capture 228 * the role change drop-down. 229 * 230 * @since 3.1.0 231 * @access public 232 * 233 * @return string The bulk action required. 234 */ 155 235 function current_action() { 156 236 if ( isset($_REQUEST['changeit']) && !empty($_REQUEST['new_role']) ) … … 160 240 } 161 241 242 /** 243 * Get a list of columns for the list table. 244 * 245 * @since 3.1.0 246 * @access public 247 * 248 * @return array Array in which the key is the ID of the column, 249 * and the value is the description. 250 */ 162 251 function get_columns() { 163 252 $c = array( … … 176 265 } 177 266 267 /** 268 * Get a list of sortable columns for the list table. 269 * 270 * @since 3.1.0 271 * @access public 272 * 273 * @return array Array of sortable columns. 274 */ 178 275 function get_sortable_columns() { 179 276 $c = array( … … 189 286 } 190 287 288 /** 289 * Generate the list table rows. 290 * 291 * @since 3.1.0 292 * @access public 293 */ 191 294 function display_rows() { 192 295 // Query the post counts for this page … … 217 320 * Generate HTML for a single row on the users.php admin panel. 218 321 * 219 * @since 2.1.0 220 * 221 * @param object $user_object 222 * @param string $style Optional. Attributes added to the TR element. Must be sanitized. 223 * @param string $role Key for the $wp_roles array. 224 * @param int $numposts Optional. Post count to display for this user. Defaults to zero, as in, a new user has made zero posts. 225 * @return string 322 * @since 3.1.0 323 * @access public 324 * 325 * @param object $user_object The current user object. 326 * @param string $style Optional. Style attributes added to the <tr> element. 327 * Must be sanitized. Default empty. 328 * @param string $role Optional. Key for the $wp_roles array. Default empty. 329 * @param int $numposts Optional. Post count to display for this user. Defaults 330 * to zero, as in, a new user has made zero posts. 331 * @return string Output for a single row. 226 332 */ 227 333 function single_row( $user_object, $style = '', $role = '', $numposts = 0 ) {
Note: See TracChangeset
for help on using the changeset viewer.