最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

hooks - Get all posts with a duplicate name

programmeradmin2浏览0评论

I am running an import script which adds a large number of product post types. Some of these are identical apart from perhaps a size or colour value in the CSV.

My script creates the new post types (WP_Product using the WC_Data_Store) and ends up with what I would call duplicates:

post-name
post-name-1
post-name-2
post-name-3
etc

Is there a hook I can run to check if a post name already exists and if so, return it so that I can add the different colour and size taxonomy terms instead?

I would ideally need to check the merchant taxonomy as well as the post name as it's possible there could be 2 different products with the same.

发布评论

评论列表(0)

  1. 暂无评论