[wp-trac] [WordPress Trac] #9968: dynamically adding/removing filters breaks plugins

WordPress Trac noreply at wordpress.org
Mon Jan 29 13:43:25 UTC 2018


#9968: dynamically adding/removing filters breaks plugins
--------------------------------------------------+-----------------------
 Reporter:  Denis-de-Bernardy                     |       Owner:
     Type:  defect (bug)                          |      Status:  reopened
 Priority:  low                                   |   Milestone:
Component:  Plugins                               |     Version:
 Severity:  normal                                |  Resolution:
 Keywords:  has-patch needs-testing dev-feedback  |     Focuses:
--------------------------------------------------+-----------------------
Changes (by nprasath002):

 * status:  closed => reopened
 * resolution:  worksforme =>


Comment:

 I was able to reproduce this with the following code


 {{{
 add_action( 'init', 'first_callback', 777 );
 add_action( 'init', 'second_callback', 778 );
 add_action( 'init', 'third_callback', 779 );

 function first_callback() {
         remove_action( 'init', 'first_callback', 777 );
 }

 function second_callback() {
         die( 'This want get executed' );
 }

 function third_callback() {
         // This will get executed
 }
 }}}

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


More information about the wp-trac mailing list