Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#38772 closed defect (bug) (fixed)

restrict_manage_posts in wp-media-list-table.php missing 2nd param

Reported by: wpsmith's profile wpsmith Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 4.8 Priority: normal
Severity: normal Version: 4.6
Component: Administration Keywords: has-patch
Focuses: Cc:

Description

restrict_manage_posts in wp-media-list-table.php missing 2nd param that is available and present within wp-admin/includes/class-wp-posts-list-table.php

Attachments (2)

class-wp-media-list-table.diff (629 bytes) - added by wpsmith 7 years ago.
Adds second param to action.
38772.diff (1.3 KB) - added by wpsmith 7 years ago.

Download all attachments as: .zip

Change History (9)

@wpsmith
7 years ago

Adds second param to action.

This ticket was mentioned in Slack in #core by helen. View the logs.


7 years ago

#2 @helen
7 years ago

  • Type changed from defect (bug) to enhancement
  • Version changed from trunk to 3.1

Seems like it makes sense to match wp-admin/includes/class-wp-posts-list-table.php.

#3 @flixos90
7 years ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 4.8
  • Type changed from enhancement to defect (bug)
  • Version changed from 3.1 to 4.6

The $which parameter was added to the restrict_manage_posts action in 37422, so I assume the filter occurrence in the media list table was overlooked. The existing patch looks good to fix that.

Regarding the ticket type, I agree with @wpsmith that this is a bug, since it should be expected that a hook has parameter parity wherever it is executed. Since it's not a bug against trunk, let's move it to 4.8.

#4 @flixos90
7 years ago

Having a second look, it might not be as simple: The media list table uses the value "bar" for its $which usage while regular post list tables use "top" or "bottom". I think the patch should also address this in the docs for the $which parameter in the post list table class:

The location of the extra table nav markup: 'top' or 'bottom' for regular post types, or 'bar' for attachments.

@wpsmith
7 years ago

#5 @wpsmith
7 years ago

Updated the patch to trunk & added documentation.

This ticket was mentioned in Slack in #core by wpsmith. View the logs.


7 years ago

#7 @SergeyBiryukov
7 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 39917:

List Tables: Pass the $which parameter to restrict_manage_posts filter instance in WP_Media_List_Table, missed in [37422].

Props wpsmith.
Fixes #38772.

Note: See TracTickets for help on using tickets.