I installed a TV SHOW plugin on my WordPress install. URLs are like this:
Now I would like to add a specific tag to redirect the user to the right TV show season like this:
This code doesn't seem to work and creates a new set of URLs instead of adding the new %season%
tag to the plugin existing permalink structure
global $wp_rewrite;
$wp_rewrite->add_rewrite_tag('%tv-show%', '([^/]+)', 'tv_show=');
$wp_rewrite->add_rewrite_tag('%season%','([^&]+)', 'season=');
$wp_rewrite->add_permastruct('tv-show', '/tv-show/%tv-show%/%season/');
$wp_rewrite->flush_rules();