Last active
March 19, 2018 06:49
-
-
Save kenmasters/c78fb6080db1a339e0f086357b247661 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
# | |
add_action( 'init', 'gta_rewrite_add_rewrites' ); | |
function gta_rewrite_add_rewrites() | |
{ | |
add_rewrite_rule('agent/?([^/]*)', 'index.php?pagename=agent&agentID=$matches[1]', 'top'); | |
} | |
add_filter('query_vars', 'gta_query_vars'); | |
function gta_query_vars($vars) { | |
$vars[] = 'agentID'; | |
return $vars; | |
} | |
# URL structure example: | |
# From: https://www.gta-link.com/agent?agentID=678 | |
# To: https://www.gta-link.com/agent/678/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment