[wp-trac] [WordPress Trac] #16031: Bulk actions: Reactivate bulk actions hook + add hander hook for all admin screens

WordPress Trac noreply at wordpress.org
Thu Jan 28 13:46:38 UTC 2016


#16031: Bulk actions: Reactivate bulk actions hook + add hander hook for all admin
screens
----------------------------+-----------------------------
 Reporter:  Veraxus         |       Owner:
     Type:  enhancement     |      Status:  assigned
 Priority:  normal          |   Milestone:  Future Release
Component:  Administration  |     Version:  3.1
 Severity:  normal          |  Resolution:
 Keywords:  dev-feedback    |     Focuses:
----------------------------+-----------------------------

Comment (by ericlewis):

 And example plugin to go along with attachment:16031.3.diff

 {{{
 #!php
 <?php
 // Add the button to the bulk action dropdown.
 add_action( 'bulk_actions-edit-post', function($actions) {
         $actions['glerf'] = 'Glerf';
         return $actions;
 });

 // Add a form submission handler.
 add_action( 'handle_bulk_actions-edit-post', function($sendback, $action)
 {
         if ( $action !== 'glerf' ) {
                 return $sendback;
         }
         $sendback = add_query_arg('glerfed', 1, $sendback);
         return $sendback;
 }, 10, 2);
 }}}

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


More information about the wp-trac mailing list