diff --git a/src/wp-admin/includes/class-wp-ms-users-list-table.php b/src/wp-admin/includes/class-wp-ms-users-list-table.php index b4cbf8457a0b4..fca80f439ca66 100644 --- a/src/wp-admin/includes/class-wp-ms-users-list-table.php +++ b/src/wp-admin/includes/class-wp-ms-users-list-table.php @@ -16,16 +16,24 @@ */ class WP_MS_Users_List_Table extends WP_List_Table { /** - * @return bool + * Checks if the current user has permissions to perform an Ajax action. + * + * @since 3.1.0 + * + * @return bool Whether the current user can perform an Ajax action. */ public function ajax_user_can() { return current_user_can( 'manage_network_users' ); } /** + * Prepares the users list for display. + * + * @since 3.1.0 + * * @global string $mode List table view mode. - * @global string $usersearch - * @global string $role + * @global string $usersearch User search query. + * @global string $role The user role to filter by. */ public function prepare_items() { global $mode, $usersearch, $role; @@ -106,7 +114,11 @@ public function prepare_items() { } /** - * @return array + * Gets the available bulk actions for the users list table. + * + * @since 3.1.0 + * + * @return array An associative array of bulk actions. */ protected function get_bulk_actions() { $actions = array(); @@ -120,14 +132,22 @@ protected function get_bulk_actions() { } /** + * Displays a message when there are no items. + * + * @since 3.1.0 */ public function no_items() { _e( 'No users found.' ); } /** - * @global string $role - * @return array + * Gets the list of views (all, super admin) available for the users list table. + * + * @since 3.1.0 + * + * @global string $role The user role to filter by. + * + * @return array An associative array of views. */ protected function get_views() { global $role; @@ -170,9 +190,13 @@ protected function get_views() { } /** + * Generates the list table pagination. + * + * @since 3.1.0 + * * @global string $mode List table view mode. * - * @param string $which + * @param string $which The location of the pagination: 'top' or 'bottom'. */ protected function pagination( $which ) { global $mode; @@ -185,7 +209,11 @@ protected function pagination( $which ) { } /** - * @return string[] Array of column titles keyed by their column name. + * Gets the list of columns for the users list table. + * + * @since 3.1.0 + * + * @return array Array of column titles keyed by their column name. */ public function get_columns() { $users_columns = array( @@ -202,13 +230,18 @@ public function get_columns() { * @since MU (3.0.0) * * @param string[] $users_columns An array of user columns. Default 'cb', 'username', - * 'name', 'email', 'registered', 'blogs'. + * @param array $users_columns An array of user columns. Default 'cb', 'username', + * 'name', 'email', 'registered', 'blogs'. */ return apply_filters( 'wpmu_users_columns', $users_columns ); } /** - * @return array + * Gets the list of sortable columns for the users list table. + * + * @since 3.1.0 + * + * @return array Sortable columns. */ protected function get_sortable_columns() { return array( @@ -349,12 +382,14 @@ public function column_registered( $user ) { } /** + * Outputs the sites column content. + * * @since 4.3.0 * - * @param WP_User $user - * @param string $classes - * @param string $data - * @param string $primary + * @param WP_User $user The current WP_User object. + * @param string $classes CSS classes for the cell. + * @param string $data Custom data attributes for the cell. + * @param string $primary The primary column name. */ protected function _column_blogs( $user, $classes, $data, $primary ) { echo ''; diff --git a/src/wp-admin/includes/class-wp-plugin-install-list-table.php b/src/wp-admin/includes/class-wp-plugin-install-list-table.php index a029d725d7b75..ba276b346f8f5 100644 --- a/src/wp-admin/includes/class-wp-plugin-install-list-table.php +++ b/src/wp-admin/includes/class-wp-plugin-install-list-table.php @@ -23,7 +23,11 @@ class WP_Plugin_Install_List_Table extends WP_List_Table { private $error; /** - * @return bool + * Checks if the current user has permissions to perform an Ajax action. + * + * @since 3.1.0 + * + * @return bool Whether the current user can perform an Ajax action. */ public function ajax_user_can() { return current_user_can( 'install_plugins' ); @@ -80,11 +84,15 @@ protected function get_installed_plugin_slugs() { } /** - * @global array $tabs - * @global string $tab - * @global int $paged - * @global string $type - * @global string $term + * Prepares the plugins list for display. + * + * @since 3.1.0 + * + * @global array $tabs The tabs shown on the Add Plugins screen. + * @global string $tab The current active tab. + * @global int $paged The current page number. + * @global string $type The type of search being performed. + * @global string $term The search term. */ public function prepare_items() { require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; @@ -287,6 +295,9 @@ public function prepare_items() { } /** + * Outputs the message when no plugins are found. + * + * @since 3.1.0 */ public function no_items() { if ( isset( $this->error ) ) { @@ -307,10 +318,14 @@ public function no_items() { } /** - * @global array $tabs - * @global string $tab + * Gets the list of views (tabs) available for the plugins list table. * - * @return array + * @since 3.1.0 + * + * @global array $tabs The tabs shown on the Add Plugins screen. + * @global string $tab The current active tab. + * + * @return array Array of view links keyed by their ID. */ protected function get_views() { global $tabs, $tab; @@ -330,7 +345,9 @@ protected function get_views() { } /** - * Overrides parent views so we can use the filter bar display. + * Displays the view (tabs) switcher for the plugins list table. + * + * @since 3.1.0 */ public function views() { $views = $this->get_views(); @@ -395,9 +412,13 @@ public function display() { } /** - * @global string $tab + * Generates the table navigation. * - * @param string $which + * @since 3.1.0 + * + * @global string $tab The current active tab. + * + * @param string $which The location of the pagination: 'top' or 'bottom'. */ protected function display_tablenav( $which ) { if ( 'featured' === $GLOBALS['tab'] ) { @@ -431,23 +452,35 @@ protected function display_tablenav( $which ) { } /** - * @return array + * Gets the list of CSS classes for the table container. + * + * @since 3.1.0 + * + * @return string[] CSS classes. */ protected function get_table_classes() { return array( 'widefat', $this->_args['plural'] ); } /** - * @return string[] Array of column titles keyed by their column name. + * Gets the list of columns for the plugins list table. + * + * @since 3.1.0 + * + * @return array Array of column titles keyed by their column name. */ public function get_columns() { return array(); } /** - * @param object $plugin_a - * @param object $plugin_b - * @return int + * Callback for sorting plugins. + * + * @since 3.1.0 + * + * @param object $plugin_a The first plugin object. + * @param object $plugin_b The second plugin object. + * @return int Comparison result. */ private function order_callback( $plugin_a, $plugin_b ) { $orderby = $this->orderby;