Changes between Initial Version and Version 1 of Ticket #17019, comment 18
- Timestamp:
- 04/07/2011 07:59:43 AM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #17019, comment 18
initial v1 13 13 }}} 14 14 15 causes my_function to be executed every time Query_Postsapplies 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?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? 16 16 17 17 So 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.