admin管理员组文章数量:1417434
I have a WordPress post which is accessible via domain/test/
What I want to be able to do is pass in a parameter using the URL - ie going to domain/test/ would load the same page as domain/test/ - but in url show the /accommodation/value1/?m=1 in the browser address bar.
I guess another way of putting it would be to say I need to be able to access domain/test/ by adding ?m=1 like to the end of the URL.
I have a WordPress post which is accessible via domain/test/
What I want to be able to do is pass in a parameter using the URL - ie going to domain/test/ would load the same page as domain/test/ - but in url show the /accommodation/value1/?m=1 in the browser address bar.
I guess another way of putting it would be to say I need to be able to access domain/test/ by adding ?m=1 like to the end of the URL.
Share Improve this question asked Jul 31, 2019 at 13:01 uDAYuDAY 12 Answers
Reset to default 0Typically, you will add the parameter to the URL on a different page. For example:
<a href="http://domain/test?m=1">Details about M1</a>
This is because the parameter affects what the server loads. So you can't go to the URL and then add the parameter after load. That's not what its for.
Thanks for reply
i have tweak my code and its working for me
add_action("init","remove_m_parameter");
function remove_m_parameter()
{
if(isset($_GET['m']))
{
unset($_GET['m']);
}
}
本文标签: url rewritingPassing parameter through permalink structure
版权声明:本文标题:url rewriting - Passing parameter through permalink structure 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745266626a2650640.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论