Skip to content

Commit

Permalink
Fixed flush in rules for map routes
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiopvilar committed Sep 12, 2015
1 parent 72979c6 commit 3f52191
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/router.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,14 @@ public function flush_rewrite_rules() {
$rules = $GLOBALS['wp_rewrite']->wp_rewrite_rules();
$need = false;
foreach($this->routes as $route) {
if ($route['regex'] && !isset( $rules[$route['regex']])) $need = true;
if ($route['regex'] &&
(
!isset( $rules[$route['regex']])
|| $rules[$route['regex']] !== 'index.php?amp_route='.$route['id']
)
) {
$need = true;
}
}

if($need){
Expand Down

0 comments on commit 3f52191

Please sign in to comment.