Please sign in to comment.
Re-add the rewrite rules on permalink change
When setting the permalink structure WP_Rewrite::set_permalink_structure() calls WP_Rewrite::init(), which empties $wp_rewrite->endpoints. Then, when flushing the rules in the middle of option-permalinks.php, the rules are also regenerated, but without our custom endpoints. This causes every request to change the permalinks to generate the wrong rewrite rules. Which makes the liveblog polling request to 404. Which is bad. This commit Fixes the problem by adding our rewrite rules every time the permalink structure is changed in addition to adding them on init. This is probably a core bug and I will further work to make isolate and report it. In the course of fixing the bug I isolated adding the rewrite rules and conditionally flushing them into separate methods, so that we can easily hook them to init/permalink_structure_change. Fixes #15.
- Loading branch information...