admin管理员组文章数量:1419640
I have a url like this:
www.domainname/product/productname
which obviously uses a wordpress custom postlink using the custom tags given to me (%postname% as my products are just custom post types) however I would like it to be www.domainname/[metaproperty1]/[metaproperty2][metaproperty3]
where meta property 1 and 2 are taxonomies that relate to sale status and location of product and meta property 3 is an id (but crucially not the post id - it's an id generated by an API that an importer uses to add products to the DB)
so essentially I need to programatically set the new permalink. Any clues? I'm currently looking at using the register_post_type
function to register my custom post type with the 'rewrite' option and including placeholders like %metaproperty1% etc etc. that would be swapped out later on with the
$wp_rewrite->add_rewrite_tag
function, is this the correct way of thinking about it?
本文标签: plugin developmentWordpress custom url without using any of the custom tags given
版权声明:本文标题:plugin development - Wordpress custom url without using any of the custom tags given 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745313693a2653053.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论