admin管理员组文章数量:1122846
When requesting short urls they are redirected to their matching permalink, for instances :
shortlink | permalink |
---|---|
/?cat=category_id |
/category_base/category_slug |
/?p=post_or_page_id |
/custom_structure/post_or_page_slug/ |
/?author=account_id |
/author/account_slug |
What's the part of the code handling this and is it customizable through hooks ?
When requesting short urls they are redirected to their matching permalink, for instances :
shortlink | permalink |
---|---|
/?cat=category_id |
/category_base/category_slug |
/?p=post_or_page_id |
/custom_structure/post_or_page_slug/ |
/?author=account_id |
/author/account_slug |
What's the part of the code handling this and is it customizable through hooks ?
Share Improve this question edited Apr 21, 2024 at 14:47 challet asked Apr 21, 2024 at 13:32 challetchallet 1114 bronze badges1 Answer
Reset to default 0That's handled by the redirect_canonical
function, set up as a default template_redirect
filter.
So it can be customized either by :
- a
template_redirect
filter, with a priority value lower than 10, so it runs before theredirect_canonical
function (which will eventually skip the next filters by making a redirect). - a
redirect_canonical
filter called by the function of the same name
本文标签: Where does the redirect from shortlink to permalink happen
版权声明:本文标题:Where does the redirect from shortlink to permalink happen? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736309758a1934133.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论