terryjsmith
Forum Replies Created
-
Forum: Plugins
In reply to: Adding rewrite rules and $wp_rewrite->flush_rules()Wow, nicely done. Unfortunately I was trying to add an endpoint so the rewrite rules become several degrees more complicated. The functionality is actually being reversed in WordPress so the original implementation will soon work as well. We’re testing a patch on the WP core.
Thanks for posting a solution though, that’s awesome that you found a workaround 🙂
Terry
Forum: Plugins
In reply to: Adding rewrite rules and $wp_rewrite->flush_rules()While I do not have a solution yet, I have spent all day (and the last week) trying to figure out the same issue with one of the WordPress core developers.
Our issue at least is in using the object cache. We have set ours up for a default timeout of 5 minutes, which is the same amount of time the URLs seemed to be “good” for.
What happening is that there is no hook available for when WP is generating the rewrite rules. This is happening before the ‘init’ action and at most other actions, the $wp_rewrite variable has not been initialized yet (even if you initialize it, it generates the rules right away).
The developer I spoke with is looking into adding another hook into the code, or possibly getting rid of the rewrite rules being transient (as of 2.8) all together.
I hope this helps; I am still searching for a temporary fix and will let you know if I find one.
Terry