[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 10:21:38 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 Review
Component:  Media         |    Version:  4.7
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 If you add a custom bulk action to the Media Library:

 {{{#!php
 <?php
 add_filter( 'bulk_actions-upload', function( $actions ) {
         $actions['foo'] = 'Foo';
         return $actions;
 } );

 }}}

 Then if nothing selected when you apply "Foo" (and you have `WP_DEBUG` on)
 you'll get a

 {{{
 PHP Notice:  Undefined variable: post_ids in .../wp-admin/upload.php on
 line 168
 }}}

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


More information about the wp-trac mailing list