Last active
March 3, 2016 05:51
-
-
Save donaldallen/0cad6e10730eddfc97a1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('rewrite_rules_array', function ($rules) { | |
$new_rules = []; | |
$new_rules['^locations/(.+?)/(.+?)/(.+?)/?$'] = 'index.php?area=$matches[1]&area=$matches[2]&area=$matches[3]'; | |
$new_rules['^locations/(.+?)/(.+?)/(.+?)/?$'] = 'index.php?area=$matches[1]&area=$matches[2]&locations=$matches[3]'; | |
$new_rules['^locations/(.+?)/(.+?)/?$'] = 'index.php?area=$matches[1]&locations=$matches[2]'; | |
$new_rules['^locations/(.+?)/(.+?)/?$'] = 'index.php?area=$matches[1]&area=$matches[2]'; | |
$new_rules['^locations/(.+?)/?$'] = 'index.php?area=$matches[1]'; | |
return $new_rules + $rules; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment