[wp-trac] [WordPress Trac] #39589: PHP Notice if nothing selected on custom bulk action in Media Library.

WordPress Trac noreply at wordpress.org
Sun Jan 15 17:36:44 UTC 2017


#39589: PHP Notice if nothing selected on custom bulk action in Media Library.
------------------------------------------------+--------------------------
 Reporter:  gitlost                             |       Owner:
     Type:  defect (bug)                        |      Status:  new
 Priority:  normal                              |   Milestone:  Awaiting
Component:  Media                               |  Review
 Severity:  normal                              |     Version:  4.7
 Keywords:  has-patch needs-testing needs-docs  |  Resolution:
                                                |     Focuses:
------------------------------------------------+--------------------------
Changes (by achbed):

 * keywords:   => has-patch needs-testing needs-docs


Comment:

 This is a first pass at fixing this.  This version does change behavior in
 two key ways.

 1) It always runs the filter, even for those cases where there is nothing
 selected.  In this case, it passes an empty array for `$post_ids`. This
 allows the filter to put up an appropriate error message.

 2) It also checks the filter return value.  If the filter returns false,
 null, or empty string, it will use the previously defined `$location`
 instead.

 This behavior change may be unexpected to some. We should discuss these
 changes to make sure these are appropriate.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39589#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list