Make WordPress Core

Changes between Version 1 and Version 2 of Ticket #17019, comment 18


Ignore:
Timestamp:
04/07/2011 08:00:13 AM (13 years ago)
Author:
kevinB
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #17019, comment 18

    v1 v2  
    1313}}}
    1414
    15 causes my_function to be executed every time WP_Query applies filters for any query; I have no choice.  Same for my_function2 and my_function3 which also want to filter posts_where, but for a different use case.  All 3 of them, when hooked directly to posts_where, will each be executed every N times post_where filters are applied.  Is there not some overhead in needless call_user_func_array() calls? 
     15causes my_function to be executed every time WP_Query applies filters for any query; I have no choice. 
     16
     17Same for my_function2 and my_function3 which also want to filter posts_where, but for a different use case.  All 3 of them, when hooked directly to posts_where, will each be executed every N times post_where filters are applied.  Is there not some overhead in needless call_user_func_array() calls? 
    1618
    1719So as it stands, my plugin code will instead hook '''one''' function to posts_where and let it route the traffic.  But most plugin / theme authors won't bother to do that, so I thought it would be better to just skip the call_user_func_array() when a context mismatch is known.