[wp-trac] [WordPress Trac] #35816: Add "after_get_posts" action to `WP_Query::get_posts()`
WordPress Trac
noreply at wordpress.org
Sat Feb 13 03:06:39 UTC 2016
#35816: Add "after_get_posts" action to `WP_Query::get_posts()`
---------------------------+--------------------------
Reporter: stevegrunwell | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 4.5
Component: Query | Version: trunk
Severity: normal | Resolution:
Keywords: | Focuses: performance
---------------------------+--------------------------
Comment (by lpawlik):
Replying to [comment:1 boonebgorges]:
> @stevegrunwell Thanks very much for the detailed request.
>
>
> So here's what I'm going to do: I'm going to swap out the
`updated_term_meta_cache` flags, and replace with `remove_filter()`. This
ought to fix your immediate issue, since the object will be removed from
the `$wp_filter` global, and PHP should be able to reclaim the memory
space. If you don't mind, I'll ask you to run this against your import
scripts, to verify that it's resolving the issue for you. Then we can talk
about whether the new action you've suggested still has a use case.
@boonebgorges thank you for your response. The problem with your solution
is that if callback is not called then hook still resides in `$wp_filter`
and it still consumes memory. I just sent to @stevegrunwell more complex
patch which seems to be solving the core of the issue. I am attaching it
here but please keep in mind that it's still a beta version :)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35816#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list