Created
May 17, 2012 18:09
-
-
Save envex/2720618 to your computer and use it in GitHub Desktop.
WordPress Custom Routes
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
| /** | |
| * | |
| * Custom routes that we'd like to use | |
| * | |
| */ | |
| function facet_rewrite_rules() { | |
| add_rewrite_rule('job/edit/([0-9]+)?$', 'index.php?pagename=job/edit&job_id=$matches[1]', 'top' ); | |
| } | |
| function facet_query_vars( $query_vars ) { | |
| $query_vars[] = 'job_id'; | |
| return $query_vars; | |
| } | |
| // Do It | |
| add_action( 'init', 'facet_rewrite_rules' ); | |
| add_filter( 'query_vars', 'facet_query_vars' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment