Make WordPress Core

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


Ignore:
Timestamp:
04/07/2011 07:59:43 AM (14 years ago)
Author:
kevinB
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #17019, comment 18

    initial v1  
    1313}}}
    1414
    15 causes my_function to be executed every time Query_Posts 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.  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? 
    1616
    1717So 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.