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

plugins - Map a custom id to wordpress post id

programmeradmin1浏览0评论

I am new to Wordpress and wondering what the best way might be to go about doing this. We have a requirement to map our own id (known as friendly_id) to the Wordpress's post id. The idea is to import a post in a different format to Wordpress so it can be edited in Wordpress. This is all on the backend.

So, lets say if a wp-admin post url comes in as /wp-admin/post.php?friendly_id=5&action=edit

I would like to map this to

/wp-admin/post.php?post_id=1&action=edit

  1. Is there a Wordpress hook that might be suited to achieve this? I have tried looking into pre_get_posts, query_vars hooks without much luck.
  2. I am thinking of storing the mapping of friendly_id to post_id in the mysql database. If there is such a hook, can it access the database to retrieve this mapping?

Thanks in advance.

发布评论

评论列表(0)

  1. 暂无评论