Consolidate *backs filter. Preserve filter settings when filetering by post. Props Viper007Bond. fixes #7920

git-svn-id: http://svn.automattic.com/wordpress/trunk@9247 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-10-19 00:38:29 +00:00
parent a4f5971898
commit 985a5b4a3f
2 changed files with 8 additions and 5 deletions

View File

@ -157,11 +157,10 @@ unset($status_links);
<select name="comment_type">
<option value="all"><?php _e('Show all comment types'); ?></option>
<?php
$comment_types = array(
$comment_types = apply_filters( 'admin_comment_types_dropdown', array(
'comment' => __('Comments'),
'pingback' => __('Pingbacks'),
'trackback' => __('Trackbacks'),
);
'pings' => __('Pings'),
) );
foreach ( $comment_types as $type => $label ) {
echo " <option value='$type'";

View File

@ -1785,6 +1785,8 @@ function _wp_get_comment_list( $status = '', $s = false, $start, $num, $post = 0
$typesql = "AND comment_type = 'pingback'";
elseif ( 'trackback' == $type )
$typesql = "AND comment_type = 'trackback'";
elseif ( 'pings' == $type )
$typesql = "AND ( comment_type = 'pingback' OR comment_type = 'trackback' )";
else
$typesql = '';
@ -1943,7 +1945,9 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true
case 'response':
echo "<td $attributes>\n";
echo "&quot;$post_link&quot; ";
echo '<a href="edit-comments.php?p=' . $post->ID . '">' . sprintf ( __ngettext('(%s comment)', '(%s comments)', $post->comment_count), $post->comment_count ) . '</a><br />';
echo '<a href="edit-comments.php?p=' . $post->ID;
if ( !empty($_GET['comment_type']) ) echo '&amp;comment_type=' . htmlspecialchars( $_GET['comment_type'] );
echo '">' . sprintf ( __ngettext('(%s comment)', '(%s comments)', $post->comment_count), $post->comment_count ) . '</a><br />';
echo get_the_time(__('Y/m/d \a\t g:ia'));
echo '</td>';
}