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
版权声明:本文标题:url rewriting - I want to add a new tag to Wordpress URL permastruct 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744668566a2618681.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论