Changeset 11622
- Timestamp:
- 03/02/2022 06:40:41 AM (3 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/admin/class-user-registrations-list-table.php
r11289 r11622 189 189 190 190 foreach ( $this->items as $i => $item ) { 191 $this->items[$i]->user = $item->created ? get_user_by( 'slug', $item->user_login ) : false; 191 $this->items[$i]->user = $item->created ? get_user_by( 'slug', $item->user_login ) : false; 192 $this->items[$i]->pending_id = (int) $this->items[$i]->pending_id; 193 $this->items[$i]->cleared = (int) $this->items[$i]->cleared; 194 $this->items[$i]->created = (int) $this->items[$i]->created; 195 $this->items[$i]->meta = json_decode( $this->items[$i]->meta ); 196 $this->items[$i]->scores = json_decode( $this->items[$i]->scores ); 192 197 } 193 198 … … 197 202 ]); 198 203 204 } 205 206 function single_row( $item ) { 207 $classes = $this->get_row_class( $item ); 208 printf( '<tr class="%s">', esc_attr( implode( ' ', $classes ) ) ); 209 $this->single_row_columns( $item ); 210 echo '</tr>'; 211 } 212 213 function get_row_class( $item ) { 214 $classes = []; 215 216 if ( ! empty( $_GET['view'] ) && 'all' !== $_GET['view'] ) { 217 return $classes; 218 } 219 220 if ( 221 $item->user && 222 'BLOCKED' === substr( $item->user->user_pass, 0, 7 ) 223 ) { 224 $classes[] = 'blocked'; 225 } elseif ( $item->created ) { 226 $classes[] = 'created'; 227 } elseif ( $item->cleared > 1 ) { 228 $classes[] = 'manually-approved'; 229 } elseif ( $item->cleared ) { 230 $classes[] = 'cleared'; 231 } else { 232 $classes[] = 'failed'; 233 } 234 235 return $classes; 199 236 } 200 237 … … 236 273 237 274 echo '<hr>'; 275 238 276 echo $this->link_to_search( $item->user_email ); 239 277 … … 293 331 294 332 function column_meta( $item ) { 295 $meta = json_decode( $item->meta );333 $meta = $item->meta; 296 334 297 335 echo '<div>'; … … 310 348 ) 311 349 ); 350 312 351 echo '<hr>'; 313 352 … … 333 372 echo ( $item->cleared ? 'Passed' : 'Failed' ) . '<br>'; 334 373 335 foreach ( json_decode( $item->scores )as $type => $val ) {374 foreach ( $item->scores as $type => $val ) { 336 375 printf( 337 376 '<abbr title="%s">%s</abbr> ', … … 341 380 } 342 381 343 $meta = json_decode( $item->meta ); 344 $akismet = $meta->akismet_result ?? ''; 382 $akismet = $item->meta->akismet_result ?? ''; 345 383 if ( $akismet ) { 346 384 printf( … … 351 389 } 352 390 353 $heuristics = $ meta->heuristics ?? '';391 $heuristics = $item->meta->heuristics ?? ''; 354 392 if ( $heuristics ) { 355 393 printf( -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/admin/ui.php
r11620 r11622 84 84 overflow: scroll; 85 85 } 86 .wp-list-table.toplevel_page_user-registrations > tbody > tr.created { 87 background-color: rgba(74, 202, 12, 0.06); 88 } 89 .wp-list-table.toplevel_page_user-registrations > tbody > tr.manually-approved { 90 background-color: rgba(74, 202, 12, 0.12); 91 } 92 .wp-list-table.toplevel_page_user-registrations > tbody > tr.cleared { 93 background-color: rgba(202, 181, 12, 0.06) 94 } 95 .wp-list-table.toplevel_page_user-registrations > tbody > tr.failed { 96 background-color: rgba(202, 12, 12, 0.06) 97 } 98 .wp-list-table.toplevel_page_user-registrations > tbody > tr.blocked { 99 background-color: rgba(202, 12, 12, 0.12) 100 } 101 .wp-list-table.toplevel_page_user-registrations > tbody td { 102 border-bottom: 1px solid #cecece; 103 } 104 .wp-list-table.toplevel_page_user-registrations > tbody hr { 105 opacity: 0.5; 106 } 86 107 </style> 87 108 <?php
Note: See TracChangeset
for help on using the changeset viewer.