Make WordPress Core

Changeset 27301


Ignore:
Timestamp:
02/26/2014 10:19:10 PM (13 years ago)
Author:
DrewAPicture
Message:

Improve inline documentation for WP_Users_List_Table.

Props leewillis77 for the initial patch.
Fixes #26564.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-users-list-table.php

    r27077 r27301  
    33 * Users List Table class.
    44 *
     5 * @since 3.1.0
     6 * @access private
     7 *
    58 * @package WordPress
    69 * @subpackage List_Table
    7  * @since 3.1.0
    8  * @access private
    910 */
    1011class WP_Users_List_Table extends WP_List_Table {
    1112
     13        /**
     14         * Site ID to generate the Users list table for.
     15         *
     16         * @since 3.1.0
     17         * @access public
     18         * @var int
     19         */
    1220        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         */
    1329        var $is_site_users;
    1430
     31        /**
     32         * Constructor.
     33         *
     34         * @since 3.1.0
     35         * @access public
     36         */
    1537        function __construct( $args = array() ) {
    1638                parent::__construct( array(
    … …  
    2648        }
    2749
     50        /**
     51         * Check the current user's permissions.
     52         *
     53         * @since 3.1.0
     54         * @access public
     55         */
    2856        function ajax_user_can() {
    2957                if ( $this->is_site_users )
    … …  
    3361        }
    3462
     63        /**
     64         * Prepare the users list for display.
     65         *
     66         * @since 3.1.0
     67         * @access public
     68         */
    3569        function prepare_items() {
    3670                global $role, $usersearch;
    … …  
    76110        }
    77111
     112        /**
     113         * Output 'no users' message.
     114         *
     115         * @since 3.1.0
     116         * @access public
     117         */
    78118        function no_items() {
    79119                _e( 'No matching users were found.' );
    80120        }
    81121
     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         */
    82134        function get_views() {
    83135                global $wp_roles, $role;
    … …  
    120172        }
    121173
     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         */
    122182        function get_bulk_actions() {
    123183                $actions = array();
    … …  
    134194        }
    135195
     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         */
    136205        function extra_tablenav( $which ) {
    137206                if ( 'top' != $which )
    … …  
    153222        }
    154223
     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         */
    155235        function current_action() {
    156236                if ( isset($_REQUEST['changeit']) && !empty($_REQUEST['new_role']) )
    … …  
    160240        }
    161241
     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         */
    162251        function get_columns() {
    163252                $c = array(
    … …  
    176265        }
    177266
     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         */
    178275        function get_sortable_columns() {
    179276                $c = array(
    … …  
    189286        }
    190287
     288        /**
     289         * Generate the list table rows.
     290         *
     291         * @since 3.1.0
     292         * @access public
     293         */
    191294        function display_rows() {
    192295                // Query the post counts for this page
    … …  
    217320         * Generate HTML for a single row on the users.php admin panel.
    218321         *
    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.
    226332         */
    227333        function single_row( $user_object, $style = '', $role = '', $numposts = 0 ) {
Note: See TracChangeset for help on using the changeset viewer.