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
- 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.
- 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.