X-Git-Url: https://scripts.mit.edu/gitweb/autoinstallsdev/wordpress.git/blobdiff_plain/38ca813a0e312e2768e5b9519f0415cd0aa84781..a349837896628462bf8c9bdc27d1477a10fe03eb:/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 66c41c4c..271fe5a0 100644
--- a/wp-admin/includes/class-wp-ms-users-list-table.php
+++ b/wp-admin/includes/class-wp-ms-users-list-table.php
@@ -32,7 +32,8 @@ class WP_MS_Users_List_Table extends WP_List_Table {
'fields' => 'all_with_meta'
);
- $args['search'] = ltrim($args['search'], '*');
+ if ( wp_is_large_network( 'users' ) )
+ $args['search'] = ltrim( $args['search'], '*' );
if ( $role == 'super' ) {
$logins = implode( "', '", get_super_admins() );
@@ -41,7 +42,7 @@ class WP_MS_Users_List_Table extends WP_List_Table {
// If the network is large and a search is not being performed, show only the latest users with no paging in order
// to avoid expensive count queries.
- if ( !$usersearch && ( get_blog_count() >= 10000 ) ) {
+ if ( !$usersearch && wp_is_large_network( 'users' ) ) {
if ( !isset($_REQUEST['orderby']) )
$_GET['orderby'] = $_REQUEST['orderby'] = 'id';
if ( !isset($_REQUEST['order']) )
@@ -117,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;
@@ -132,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();
@@ -161,10 +170,10 @@ class WP_MS_Users_List_Table extends WP_List_Table {
$attributes = "$class$style";
-
switch ( $column_name ) {
case 'cb': ?>
+
|
user_email, 32 );
- if ( get_current_user_id() == $user->ID ) {
- $edit_link = esc_url( network_admin_url( 'profile.php' ) );
- } else {
- $edit_link = esc_url( network_admin_url( add_query_arg( 'wp_http_referer', urlencode( stripslashes( $_SERVER['REQUEST_URI'] ) ), 'user-edit.php?user_id=' . $user->ID ) ) );
- }
+ $edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), get_edit_user_link( $user->ID ) ) );
echo ""; ?>
- user_login ); ?>user_login; ?>user_login, $super_admins ) )
echo ' - ' . __( 'Super Admin' );
?>
@@ -188,10 +193,20 @@ class WP_MS_Users_List_Table extends WP_List_Table {
$actions = array();
$actions['edit'] = '' . __( 'Edit' ) . '';
- if ( current_user_can( 'delete_user', $user->ID) && ! in_array( $user->user_login, $super_admins ) ) {
- $actions['delete'] = '' . __( 'Delete' ) . '';
+ if ( current_user_can( 'delete_user', $user->ID ) && ! in_array( $user->user_login, $super_admins ) ) {
+ $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 );
?>
@@ -226,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' ) . '';
@@ -241,9 +256,19 @@ class WP_MS_Users_List_Table extends WP_List_Table {
if ( get_blog_status( $val->userblog_id, 'archived' ) == 1 )
$class .= 'site-archived ';
- $actions['view'] = '' . __( 'View' ) . '';
+ $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 );
@@ -262,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;
@@ -273,5 +299,3 @@ class WP_MS_Users_List_Table extends WP_List_Table {
}
}
}
-
-?>
|