-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Permalink flush isn't always happening #40
Comments
Try this, replace Line 96 in 71ea40a
with global $wp_rewrite;
$wp_rewrite->flush_rules(); |
@soderlind Yes, that is often the best way to do it. -1 me. I know that epoch-api, pre-this version worked properly with ugly permalinks. Which might mean that the flush never worked, but wasn't needed. Got to check if the new rewrite rule for the iFrame is in fact ugly permalinks compatible, and our flush enables that. |
In my example plugin, I only flush if the permalink doesn't exist: /**************************************************************************
* Flushes the permalink structure.
* flush_rules is an extremely costly function in terms of performance, and
* should only be run when changing the rule.
*
* @see http://codex.wordpress.org/Rewrite_API/flush_rules
**************************************************************************/
function my_permalink_flush_rewrite_rules() {
$rules = $GLOBALS['wp_rewrite']->wp_rewrite_rules();
if ( ! isset( $rules['my-permalink/(.*)$'] ) ) { // must be the same rule as in my_permalink_rewrite_rule($wp_rewrite)
global $wp_rewrite;
$wp_rewrite->flush_rules();
}
} |
close via a24c41f |
Issue #39 indicates that the necessary permalink flush is not always happening... I presume, since we havn't heard more that this is an edge case, but still.
The text was updated successfully, but these errors were encountered: