https://codex.wordpress.org/Plugin_API/Action_Reference/generate_rewrite_rules
function codex_custom_endpoint( $wp_rewrite ) {
$feed_rules = array(
'my-account/?$' => 'index.php?account-page=true',
'my-account/edit-profile/?$' => 'index.php?account-edit-profile=true',
);
$wp_rewrite->rules = $feed_rules + $wp_rewrite->rules;
return $wp_rewrite->rules;
}
add_filter( 'generate_rewrite_rules', 'codex_custom_endpoint' );

No comments:
Post a Comment