Ticket #12555: 10607-and-12555.diff
File 10607-and-12555.diff, 2.5 KB (added by , 15 years ago) |
---|
-
wp-admin/users.php
370 370 $role = array_shift($roles); 371 371 372 372 $style = ( ' class="alternate"' == $style ) ? '' : ' class="alternate"'; 373 echo "\n\t", user_row( $user_object, $style, $role, isset( $post_counts[ $userid ] ) ? $post_counts[ $userid ] : 0);373 echo "\n\t", user_row( $user_object, $style, $role, $post_counts[ $userid ] ); 374 374 } 375 375 ?> 376 376 </tbody> -
wp-includes/user.php
169 169 global $wpdb; 170 170 171 171 $count = array(); 172 if ( ! count( $users ) )172 if ( ! is_array($users) || empty( $users ) ) 173 173 return $count; 174 174 175 175 $userlist = implode( ',', $users ); … … 177 177 178 178 $result = $wpdb->get_results( "SELECT post_author, COUNT(*) FROM $wpdb->posts $where AND post_author IN ($userlist) GROUP BY post_author", ARRAY_N ); 179 179 180 if ( ! $result ) 181 return $count; 182 183 foreach ( $result as $row ) { 180 foreach ( $result as $row ) 184 181 $count[ $row[0] ] = $row[1]; 185 }186 182 187 foreach ( $users as $id ) {183 foreach ( $users as $id ) 188 184 if ( ! isset( $count[ $id ] ) ) 189 185 $count[ $id ] = 0; 190 }191 186 192 187 return $count; 193 188 } -
wp-includes/wp-db.php
445 445 var $dbuser; 446 446 447 447 /** 448 * {@internal Missing Description}} 449 * 450 * @since unknown 451 * @access public 452 * @var unknown 453 */ 454 var $func_call; 455 456 /** 448 457 * Connects to the database server and selects a database 449 458 * 450 459 * PHP4 compatibility layer for calling the PHP5 constructor. … … 1387 1396 } elseif ( $output == ARRAY_A || $output == ARRAY_N ) { 1388 1397 // Return an integer-keyed array of... 1389 1398 if ( $this->last_result ) { 1390 $i = 0;1391 1399 foreach( (array) $this->last_result as $row ) { 1392 1400 if ( $output == ARRAY_N ) { 1393 1401 // ...integer-keyed row arrays 1394 $new_array[ $i] = array_values( get_object_vars( $row ) );1402 $new_array[] = array_values( get_object_vars( $row ) ); 1395 1403 } else { 1396 1404 // ...column name-keyed row arrays 1397 $new_array[ $i] = get_object_vars( $row );1405 $new_array[] = get_object_vars( $row ); 1398 1406 } 1399 ++$i;1400 1407 } 1401 return $new_array;1402 1408 } 1409 return $new_array; 1403 1410 } 1411 return null; 1404 1412 } 1405 1413 1406 1414 /**