X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/11be15bd505d66a91e2c80062190b13e315a04a9..888fa4ed68091f3314f711c5f6fe75858bf5410b:/wp-admin/includes/class-wp-ms-users-list-table.php diff --git a/wp-admin/includes/class-wp-ms-users-list-table.php b/wp-admin/includes/class-wp-ms-users-list-table.php index ab1ee362..df064068 100644 --- a/wp-admin/includes/class-wp-ms-users-list-table.php +++ b/wp-admin/includes/class-wp-ms-users-list-table.php @@ -16,7 +16,7 @@ class WP_MS_Users_List_Table extends WP_List_Table { function prepare_items() { global $usersearch, $role, $wpdb, $mode; - $usersearch = isset( $_REQUEST['s'] ) ? $_REQUEST['s'] : ''; + $usersearch = isset( $_REQUEST['s'] ) ? wp_unslash( trim( $_REQUEST['s'] ) ) : ''; $users_per_page = $this->get_items_per_page( 'users_network_per_page' ); @@ -118,6 +118,14 @@ class WP_MS_Users_List_Table extends WP_List_Table { 'registered' => _x( 'Registered', 'user' ), 'blogs' => __( 'Sites' ) ); + /** + * Filter the columns displayed in the Network Admin Users list table. + * + * @since MU + * + * @param array $users_columns An array of user columns. Default 'cb', 'username', + * 'name', 'email', 'registered', 'blogs'. + */ $users_columns = apply_filters( 'wpmu_users_columns', $users_columns ); return $users_columns; @@ -133,7 +141,7 @@ class WP_MS_Users_List_Table extends WP_List_Table { } function display_rows() { - global $current_site, $mode; + global $mode; $alt = ''; $super_admins = get_super_admins(); @@ -189,6 +197,16 @@ class WP_MS_Users_List_Table extends WP_List_Table { $actions['delete'] = '' . __( 'Delete' ) . ''; } + /** + * Filter the action links displayed under each user + * in the Network Admin Users list table. + * + * @since 3.2.0 + * + * @param array $actions An array of action links to be displayed. + * Default 'Edit', 'Delete'. + * @param WP_User $user WP_User object. + */ $actions = apply_filters( 'ms_user_row_actions', $actions, $user ); echo $this->row_actions( $actions ); ?> @@ -223,7 +241,7 @@ class WP_MS_Users_List_Table extends WP_List_Table { $path = ( $val->path == '/' ) ? '' : $val->path; echo ''; - echo '' . str_replace( '.' . $current_site->domain, '', $val->domain . $path ) . ''; + echo '' . str_replace( '.' . get_current_site()->domain, '', $val->domain . $path ) . ''; echo ' '; $actions = array(); $actions['edit'] = '' . __( 'Edit' ) . ''; @@ -240,7 +258,17 @@ class WP_MS_Users_List_Table extends WP_List_Table { $actions['view'] = '' . __( 'View' ) . ''; - $actions = apply_filters('ms_user_list_site_actions', $actions, $val->userblog_id); + /** + * Filter the action links displayed next the sites a user belongs to + * in the Network Admin Users list table. + * + * @since 3.1.0 + * + * @param array $actions An array of action links to be displayed. + * Default 'Edit', 'View'. + * @param int $userblog_id The site ID. + */ + $actions = apply_filters( 'ms_user_list_site_actions', $actions, $val->userblog_id ); $i=0; $action_count = count( $actions ); @@ -259,6 +287,7 @@ class WP_MS_Users_List_Table extends WP_List_Table { default: echo ""; + /** This filter is documented in wp-admin/includes/class-wp-users-list-table.php */ echo apply_filters( 'manage_users_custom_column', '', $column_name, $user->ID ); echo ""; break;