#21572 closed defect (bug) (invalid)
Unnecessary function argument for display_rows
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | trivial | Version: | |
Component: | Administration | Keywords: | |
Focuses: | Cc: |
Description
display_rows($posts = array()) in /wp-admin/includes/class-wp-posts-list-table.php (line 303) overrides display_rows() in /wp-admin/includes/class-wp-list-table.php (line 807).
display_rows($posts = array()) never uses the $posts argument because $posts is assigned $wp_query->posts later on in the function.
This argument and the if(empty($posts)) check later in the function are extraneous.
Attachments (1)
Change History (4)
#1
@
13 years ago
- Milestone changed from Awaiting Review to 3.5
The $level = 0 parameter is also useless, yes? We add an argument to a method we override but never use it. This is likely confusion stemming from _display_rows().
Patch looks good otherwise. If uploaded with a diff or patch extension, it will be color-coded here on Trac.
#2
@
13 years ago
- Resolution set to invalid
- Status changed from new to closed
Line 1368 of ajax-actions.php:
$wp_list_table = _get_list_table('WP_Posts_List_Table');
$level
gets set, and then....
Line 1382 of ajax-actions.php:
$wp_list_table->display_rows( array( get_post( $_POST['post_ID'] ) ), $level );
Uses both arguments... so, the patch would break that...
removed function argument and empty check