I hope you all are doing well.
I need to ask something, I tried searching for this but unable to get any relevant answer. I have a JSON feed and using that feed I want to create posts and want to sync/updated those posts whenever JSON feeds changes. Please guide me in this regards.
I know how to create post with JSON feed but don't know how to keep posts sync with that JSON feed.
What I want to achieve using that feed is:
a. If post doesn't exists in Wordpress DB then add it
b. If post exists in Wordpress DB then update it
Updated
One more question I need to ask, what if JSON changes and the item in wordpress post is not available in that updated JSON, in simple words I also want to delete all the items available in posts that previously available in JSON but after JSON changes it's not there.
Thanks,
Neil Bannet
wp_insert_post()does exactly that: if the passed post ID exists, the post is updated; otherwise a post is created. What problems exactly do you have to do it?