Created
September 2, 2012 01:44
-
-
Save leoj3n/3593560 to your computer and use it in GitHub Desktop.
Pippins' question: An a WP site, adding query args like this /checkout/?an_action=this is causing 404 errors. Doesn't matter what query arg. Ideas?
This file contains hidden or 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
// a possible workaround | |
function my_add_rewrites($content) { | |
global $wp_rewrite; | |
$new_non_wp_rules = array( | |
site_url('checkout/(*)') => plugins_url('checkout.php?$1'); | |
); | |
$wp_rewrite->non_wp_rules = array_merge($wp_rewrite->non_wp_rules, $new_non_wp_rules); | |
return $content; | |
} | |
add_action('generate_rewrite_rules', 'my_add_rewrites'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
checkout.php isn't part the plugin. It's a page on the site.