Changeset 11035
- Timestamp:
- 04/21/2009 09:12:01 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit-comments.php
r10943 r11035 86 86 $mode = ( ! isset($_GET['mode']) || empty($_GET['mode']) ) ? 'detail' : attribute_escape($_GET['mode']); 87 87 88 $comment_status = !empty($_GET['comment_status']) ? attribute_escape($_GET['comment_status']) : ''; 88 $default_status = get_user_option('edit_comments_last_view'); 89 if ( empty($default_status) ) 90 $default_status = 'all'; 91 $comment_status = isset($_REQUEST['comment_status']) ? $_REQUEST['comment_status'] : $default_status; 92 if ( !in_array($comment_status, array('all', 'moderated', 'approved', 'spam')) ) 93 $comment_status = 'all'; 94 if ( $comment_status != $default_status ) 95 update_usermeta($current_user->ID, 'edit_comments_last_view', $comment_status); 89 96 90 97 $comment_type = !empty($_GET['comment_type']) ? attribute_escape($_GET['comment_type']) : ''; … … 142 149 'spam' => _n_noop('Spam (<span class="spam-count">%s</span>)', 'Spam (<span class="spam-count">%s</span>)') 143 150 ); 144 $class = ( '' === $comment_status ) ? ' class="current"' : '';145 // $status_links[] = "<li><a href='edit-comments.php'$class>" . __( 'All' ) . '</a>';146 151 $link = 'edit-comments.php'; 147 152 if ( !empty($comment_type) && 'all' != $comment_type ) … … 150 155 $class = ''; 151 156 152 if ( str_replace( 'all', '', $status )== $comment_status )157 if ( $status == $comment_status ) 153 158 $class = ' class="current"'; 154 159 if ( !isset( $num_comments->$status ) ) 155 160 $num_comments->$status = 10; 156 if ( 'all' != $status ) 157 $link = add_query_arg( 'comment_status', $status, $link ); 161 $link = add_query_arg( 'comment_status', $status, $link ); 158 162 if ( $post_id ) 159 163 $link = add_query_arg( 'p', absint( $post_id ), $link ); … … 245 249 <select name="action"> 246 250 <option value="-1" selected="selected"><?php _e('Bulk Actions') ?></option> 247 <?php if ( empty($comment_status)|| 'approved' == $comment_status ): ?>251 <?php if ( 'all' == $comment_status || 'approved' == $comment_status ): ?> 248 252 <option value="unapprove"><?php _e('Unapprove'); ?></option> 249 253 <?php endif; ?> 250 <?php if ( empty($comment_status)|| 'moderated' == $comment_status || 'spam' == $comment_status ): ?>254 <?php if ( 'all' == $comment_status || 'moderated' == $comment_status || 'spam' == $comment_status ): ?> 251 255 <option value="approve"><?php _e('Approve'); ?></option> 252 256 <?php endif; ?> … … 259 263 <?php wp_nonce_field('bulk-comments'); ?> 260 264 261 <?php if ( $comment_status )echo "<input type='hidden' name='comment_status' value='$comment_status' />\n"; ?>265 <?php echo "<input type='hidden' name='comment_status' value='$comment_status' />\n"; ?> 262 266 <select name="comment_type"> 263 267 <option value="all"><?php _e('Show all comment types'); ?></option> … … 333 337 <select name="action2"> 334 338 <option value="-1" selected="selected"><?php _e('Bulk Actions') ?></option> 335 <?php if ( empty($comment_status)|| 'approved' == $comment_status ): ?>339 <?php if ( 'all' == $comment_status || 'approved' == $comment_status ): ?> 336 340 <option value="unapprove"><?php _e('Unapprove'); ?></option> 337 341 <?php endif; ?> 338 <?php if ( empty($comment_status)|| 'moderated' == $comment_status || 'spam' == $comment_status ): ?>342 <?php if ( 'all' == $comment_status || 'moderated' == $comment_status || 'spam' == $comment_status ): ?> 339 343 <option value="approve"><?php _e('Approve'); ?></option> 340 344 <?php endif; ?> … … 369 373 <div id="ajax-response"></div> 370 374 371 <?php } elseif ( isset($_GET['comment_status']) && 'moderated' == $_GET['comment_status']) { ?>375 <?php } elseif ( 'moderated' == $comment_status ) { ?> 372 376 <p><?php _e('No comments awaiting moderation… yet.') ?></p> 373 377 </form>
Note: See TracChangeset
for help on using the changeset viewer.