[wp-trac] [WordPress Trac] #17817: do_action/apply_filters/etc. recursion on same filter kills underlying call

WordPress Trac noreply at wordpress.org
Tue Apr 16 15:58:55 UTC 2013


#17817: do_action/apply_filters/etc. recursion on same filter kills underlying call
----------------------------------------+-----------------------
 Reporter:  kernfel                     |       Owner:
     Type:  defect (bug)                |      Status:  reopened
 Priority:  normal                      |   Milestone:  3.6
Component:  Plugins                     |     Version:  3.4.1
 Severity:  normal                      |  Resolution:
 Keywords:  has-patch needs-unit-tests  |
----------------------------------------+-----------------------

Comment (by jbrinley):

 If it were a matter of creating the WP plugin API from scratch, I would
 agree with you. But you're talking about a backwards-incompatible change;
 plugins ''will'' break. We need to approach that much more cautiously.

   The only way a plugin author could know, would be to have read the
 source code of do_action, wp_update_post, and everything else that stemmed
 from it.

 Or we could update the codex so that users of the function know that
 they'll be triggering certain hooks.

 If you want to go forward with this, the first step is to figure out a way
 to deprecate the old functionality without breaking it. E.g., throw a
 `_deprecated_argument` warning or some such when calling
 `add_action`/`add_filter` on the currently running hook. Keep that in
 there for a version or two before breaking things. Set a target version a
 bit in the future so plugin developers know when their code will stop
 working. This is a big change; people deserve the notice.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/17817#comment:19>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list