- Timestamp:
- 02/09/2018 06:45:30 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-comments-list-table.php
r42670 r42684 79 79 80 80 $comment_status = isset( $_REQUEST['comment_status'] ) ? $_REQUEST['comment_status'] : 'all'; 81 if ( ! in_array( $comment_status, array( 'all', 'm oderated', 'approved', 'spam', 'trash' ) ) ) {81 if ( ! in_array( $comment_status, array( 'all', 'mine', 'moderated', 'approved', 'spam', 'trash' ) ) ) { 82 82 $comment_status = 'all'; 83 83 } … … 117 117 118 118 $status_map = array( 119 'mine' => '', 119 120 'moderated' => 'hold', 120 121 'approved' => 'approve', … … 223 224 ), // singular not used 224 225 226 /* translators: %s: current user's comments count */ 227 'mine' => _nx_noop( 228 'Mine <span class="count">(%s)</span>', 229 'Mine <span class="count">(%s)</span>', 230 'comments' 231 ), 232 225 233 /* translators: %s: pending comments count */ 226 234 'moderated' => _nx_noop( … … 266 274 if ( $status === $comment_status ) { 267 275 $current_link_attributes = ' class="current" aria-current="page"'; 276 } 277 278 if ( 'mine' === $status ) { 279 $current_user_id = get_current_user_id(); 280 $num_comments->mine = get_comments( array( 281 'user_id' => $current_user_id, 282 'count' => true, 283 ) ); 284 $link = add_query_arg( 'user_id', $current_user_id, $link ); 285 } else { 286 $link = remove_query_arg( 'user_id', $link ); 268 287 } 269 288 … … 294 313 * 295 314 * @since 2.5.0 296 * 297 * @param array $status_links An array of fully-formed status links. Default 'All'. 298 * Accepts 'All', 'Pending', 'Approved', 'Spam', and 'Trash'. 315 * @since 5.0.0 The 'Mine' link was added. 316 * 317 * @param string[] $status_links An associative array of fully-formed comment status links. Includes 'All', 'Mine', 318 * 'Pending', 'Approved', 'Spam', and 'Trash'. 299 319 */ 300 320 return apply_filters( 'comment_status_links', $status_links );
Note: See TracChangeset
for help on using the changeset viewer.