Make WordPress Core

Changeset 4659


Ignore:
Timestamp:
12/21/2006 11:40:16 PM (18 years ago)
Author:
markjaquith
Message:

Categories with zero posts and posts with no comments no longer link to those empty views in the admin. fixes #3493

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-functions.php

    r4658 r4659  
    761761    $category->category_count = number_format( $category->category_count );
    762762    $category->link_count = number_format( $category->link_count );
     763    $posts_count = ( $category->category_count > 0 ) ? "<a href='edit.php?cat=$category->cat_ID'>$category->category_count</a>" : $category->category_count;
    763764    return "<tr id='cat-$category->cat_ID'$class>
    764765        <th scope='row' style='text-align: center'>$category->cat_ID</th>
    765766        <td>" . ( $name_override ? $name_override : $pad . ' ' . $category->cat_name ) . "</td>
    766767        <td>$category->category_description</td>
    767         <td align='center'><a href='edit.php?cat=$category->cat_ID'>$category->category_count</a></td>
     768        <td align='center'>$posts_count</td>
    768769        <td align='center'>$category->link_count</td>
    769770        <td>$edit</td>\n\t</tr>\n";
  • trunk/wp-admin/edit.php

    r4658 r4659  
    196196    case 'comments':
    197197        ?>
    198         <td style="text-align: center"><a href="edit.php?p=<?php echo $id ?>&amp;c=1">
    199             <?php comments_number(__('0'), __('1'), __('%')) ?>
    200             </a></td>
     198        <td style="text-align: center">
     199            <?php comments_number(__('0'), "<a href='edit.php?p=$id&amp;c=1'>" . __('1') . '</a>', "<a href='edit.php?p=$id&amp;c=1'>" . __('%') . '</a>') ?>
     200            </td>
    201201        <?php
    202202        break;
Note: See TracChangeset for help on using the changeset viewer.