Changeset 13200
- Timestamp:
- 02/12/2024 06:40:39 AM (17 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/admin/class-user-registrations-list-table.php
r12207 r13200 70 70 } 71 71 72 $url = add_query_arg( 'view', $item[0], $url ); 72 if ( 'all' !== $item[0] ) { 73 $url = add_query_arg( 'view', $item[0], $url ); 74 } 73 75 74 76 return sprintf( … … 128 130 129 131 // Join if the view needs the users or description table. 130 if ( strpos( $where . $join, 'users.' ) || strpos( $where, 'description.' ) ) {132 if ( strpos( $where . $join, 'users.' ) || strpos( $where, 'description.' ) || ( 'banned-users' === $view ?: ( $_REQUEST['view'] ?? 'all' ) ) ) { 131 133 $join .= " LEFT JOIN {$wpdb->users} users ON registrations.created = 1 AND registrations.user_login = users.user_login"; 132 134 } 133 135 if ( strpos( $where, 'description.' ) ) { 134 136 $join .= " LEFT JOIN {$wpdb->usermeta} description ON users.ID = description.user_id AND description.meta_key = 'description'"; 137 } 138 139 if ( 'banned-users' === $view ?: ( $_REQUEST['view'] ?? 'all' ) ) { 140 $join .= " LEFT JOIN {$wpdb->usermeta} notes ON users.ID = notes.user_id AND notes.meta_key = '_wporg_bbp_user_notes'"; 135 141 } 136 142 … … 162 168 array(), 163 169 $this->get_sortable_columns(), 164 ); 165 166 $sort_column = $_GET['orderby'] ?? 'pending_id'; 167 $sort_order = strtoupper( $_GET['order'] ?? 'DESC' ); 168 169 if ( ! in_array( $sort_order, [ 'DESC', 'ASC' ] ) ) { 170 $sort_order = 'DESC'; 171 } 172 if ( ! isset( $this->get_sortable_columns()[ $sort_column ] ) ) { 173 $sort_column = 'pending_id'; 174 } 175 176 $per_page = $this->get_items_per_page( 'users_per_page', 100 ); 177 $current_page = $this->get_pagenum(); 178 179 $join_where = $this->get_join_where_sql(); 180 181 $per_page_offset = ($current_page-1) * $per_page; 170 ); 171 172 $sort_column = $_GET['orderby'] ?? 'pending_id'; 173 $sort_order = strtoupper( $_GET['order'] ?? 'DESC' ); 174 175 if ( ! in_array( $sort_order, [ 'DESC', 'ASC' ] ) ) { 176 $sort_order = 'DESC'; 177 } 178 if ( ! isset( $this->get_sortable_columns()[ $sort_column ] ) ) { 179 $sort_column = 'pending_id'; 180 } 181 if ( 'banned-users' === ( $_GET['view'] ?? '' ) ) { 182 $sort_column = 'notes.umeta_id'; 183 $sort_order = 'DESC'; 184 } 185 186 $per_page = $this->get_items_per_page( 'users_per_page', 100 ); 187 $current_page = $this->get_pagenum(); 188 189 $join_where = $this->get_join_where_sql(); 190 191 $per_page_offset = ($current_page-1) * $per_page; 182 192 183 193 $this->items = $wpdb->get_results( … … 431 441 function link_to_search( $s ) { 432 442 $parts = preg_split( '/([^\w\.-])/ui', $s, -1, PREG_SPLIT_DELIM_CAPTURE ); 443 if ( ! $parts ) { 444 $parts = array( $s ); 445 } 433 446 434 447 return implode( '', array_map( function( $s ) {
Note: See TracChangeset
for help on using the changeset viewer.