plugin development - Wordpress custom url without using any of the custom tags given

I have a url like this:www.domainnameproductproductname which obviously uses a wordpress custom postlink using the cus

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?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745313693a4622118.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信