Ticket #29128: 29128.patch
File 29128.patch, 4.4 KB (added by , 10 years ago) |
---|
-
wp-admin/css/common.css
538 538 .widefat .num, 539 539 .column-comments, 540 540 .column-links, 541 .column-posts { 541 .column-posts, 542 .column-pages { 542 543 text-align: center; 543 544 } 544 545 -
wp-admin/css/list-tables-rtl.css
255 255 } 256 256 257 257 .fixed .column-posts, 258 .fixed .column-pages, 258 259 .fixed .column-date, 259 260 .fixed .column-parent, 260 261 .fixed .column-links, … … 263 264 width: 10%; 264 265 } 265 266 266 .fixed .column-posts { 267 .fixed .column-posts, 268 .fixed .column-pages { 267 269 width: 74px; 268 270 } 269 271 -
wp-admin/css/list-tables.css
255 255 } 256 256 257 257 .fixed .column-posts, 258 .fixed .column-pages, 258 259 .fixed .column-date, 259 260 .fixed .column-parent, 260 261 .fixed .column-links, … … 263 264 width: 10%; 264 265 } 265 266 266 .fixed .column-posts { 267 .fixed .column-posts, 268 .fixed .column-pages { 267 269 width: 74px; 268 270 } 269 271 -
wp-admin/includes/class-wp-list-table.php
836 836 837 837 if ( 'cb' == $column_key ) 838 838 $class[] = 'check-column'; 839 elseif ( in_array( $column_key, array( 'posts', 'comments', 'links' ) ) )839 elseif ( in_array( $column_key, array( 'posts', 'comments', 'links', 'pages' ) ) ) 840 840 $class[] = 'num'; 841 841 842 842 if ( isset( $sortable[$column_key] ) ) { -
wp-admin/includes/class-wp-users-list-table.php
263 263 'name' => __( 'Name' ), 264 264 'email' => __( 'E-mail' ), 265 265 'role' => __( 'Role' ), 266 'posts' => __( 'Posts' ) 266 'posts' => __( 'Posts' ), 267 'pages' => __( 'Pages' ) 267 268 ); 268 269 269 270 if ( $this->is_site_users ) … … 300 301 * @access public 301 302 */ 302 303 public function display_rows() { 303 // Query the post counts for this page304 // Query the post and page counts for this page 304 305 if ( ! $this->is_site_users ) 305 306 $post_counts = count_many_users_posts( array_keys( $this->items ) ); 307 $page_counts = count_many_users_posts( array_keys( $this->items ), 'page' ); 306 308 307 309 $editable_roles = array_keys( get_editable_roles() ); 308 310 … … 320 322 continue; 321 323 322 324 $style = ( ' class="alternate"' == $style ) ? '' : ' class="alternate"'; 323 echo "\n\t" . $this->single_row( $user_object, $style, $role, isset( $post_counts ) ? $post_counts[ $userid ] : 0 );325 echo "\n\t" . $this->single_row( $user_object, $style, $role, isset( $post_counts ) ? $post_counts[ $userid ] : 0, isset( $page_counts ) ? $page_counts[ $userid ] : 0 ); 324 326 } 325 327 } 326 328 … … 336 338 * @param string $role Optional. Key for the $wp_roles array. Default empty. 337 339 * @param int $numposts Optional. Post count to display for this user. Defaults 338 340 * to zero, as in, a new user has made zero posts. 341 * @param int $numpages Optional. Page count to display for this user. Defaults 342 * to zero, as in, a new user has made zero pages. 339 343 * @return string Output for a single row. 340 344 */ 341 public function single_row( $user_object, $style = '', $role = '', $numposts = 0 ) {345 public function single_row( $user_object, $style = '', $role = '', $numposts = 0, $numpages = 0 ) { 342 346 global $wp_roles; 343 347 344 348 if ( !( is_object( $user_object ) && is_a( $user_object, 'WP_User' ) ) ) … … 436 440 } 437 441 $r .= "</td>"; 438 442 break; 443 case 'pages': 444 $attributes = 'class="pages column-pages num"' . $style; 445 $r .= "<td $attributes>"; 446 if ( $numpages > 0 ) { 447 $r .= "<a href='edit.php?post_type=page&author=$user_object->ID' title='" . esc_attr__( 'View pages by this author' ) . "' class='edit'>"; 448 $r .= $numpages; 449 $r .= '</a>'; 450 } else { 451 $r .= 0; 452 } 453 $r .= "</td>"; 454 break; 439 455 default: 440 456 $r .= "<td $attributes>";