admin管理员组

文章数量:1414687

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();

本文标签: url rewritingI want to add a new tag to Wordpress URL permastruct