Changeset 9046 for trunk/wp-admin/edit-comments.php
- Timestamp:
- 10/01/2008 03:48:45 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit-comments.php
r9032 r9046 73 73 $mode = ( ! isset($_GET['mode']) || empty($_GET['mode']) ) ? 'detail' : attribute_escape($_GET['mode']); 74 74 75 $comment_status = isset($_GET['comment_status']) ? attribute_escape($_GET['comment_status']) : ''; 75 $comment_status = !empty($_GET['comment_status']) ? attribute_escape($_GET['comment_status']) : ''; 76 77 $comment_type = !empty($_GET['comment_type']) ? attribute_escape($_GET['comment_type']) : ''; 76 78 77 79 $post_id = isset($_GET['p']) ? (int) $_GET['p'] : 0; … … 135 137 $class = ( '' === $comment_status ) ? ' class="current"' : ''; 136 138 $status_links[] = "<li><a href=\"edit-comments.php\"$class>".__('Show All Comments')."</a>"; 139 $type = ( !$comment_type && 'all' != $comment_type ) ? '' : "&comment_type=$comment_type"; 137 140 foreach ( $stati as $status => $label ) { 138 141 $class = ''; … … 141 144 $class = ' class="current"'; 142 145 143 $status_links[] = "<li class='$status'><a href=\"edit-comments.php?comment_status=$status \"$class>$label</a>";146 $status_links[] = "<li class='$status'><a href=\"edit-comments.php?comment_status=$status$type\"$class>$label</a>"; 144 147 } 145 148 … … 150 153 ?> 151 154 </ul> 155 156 <div class="filter"> 157 <form id="list-filter" action="" method="get"> 158 <?php if ( $comment_status ) echo "<input type='hidden' name='comment_status' value='$comment_status' />\n"; ?> 159 <select name="comment_type"> 160 <option value="all"><?php _e('Show all comment types'); ?></option> 161 <?php 162 $comment_types = array( 163 'comment' => __('Comments'), 164 'pingback' => __('Pingbacks'), 165 'trackback' => __('Trackbacks'), 166 ); 167 168 foreach ( $comment_types as $type => $label ) { 169 echo " <option value='$type'"; 170 selected( $comment_type, $type ); 171 echo ">$label</option>\n"; 172 } 173 ?> 174 </select> 175 <input type="submit" id="post-query-submit" value="<?php _e('Filter'); ?>" class="button-secondary" /> 176 </form> 177 </div> 152 178 153 179 <?php … … 161 187 $start = $offset = ( $page - 1 ) * $comments_per_page; 162 188 163 list($_comments, $total) = _wp_get_comment_list( $comment_status, $search_dirty, $start, $comments_per_page + 5, $post_id ); // Grab a few extra189 list($_comments, $total) = _wp_get_comment_list( $comment_status, $search_dirty, $start, $comments_per_page + 5, $post_id, $comment_type ); // Grab a few extra 164 190 165 191 $comments = array_slice($_comments, 0, $comments_per_page);
Note: See TracChangeset
for help on using the changeset viewer.