Skip to content

Instantly share code, notes, and snippets.

@delias
Forked from educartoons/wordpress_rewrite
Created November 7, 2018 04:04
function chaplains_init() {
global $wp,$wp_rewrite;
$wp_rewrite->add_rule('chaplains/([0-9]{4})/?$',
'index.php?pagename=mypage&id=$matches[1]', 'top');
// $wp_rewrite->flush_rules(false);
}
add_action('init','chaplains_init');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment