plugins – Update post meta Rest Api
I have to work on a WordPress that uses the plugin Easy Post View Count, which by default does not support rest api.
With the plugin Custom rest api i’ve been able to get these post meta inside the post response of rest api, which looks like this
“post_view_count_101047: 47”
Where the numbers stands for the post Id and value the numbers of views.
My question is how I can edit these post meta using React and Rest Api ? I’m struggling to understand how to write on that endpoint since it’s basically one post response api = every post_view_count_[post_id] where only the post_view_count_[post_id] that match the post Id is populated
here the post id is 212887, and this is part of the response for post/212887
Is there a better way ?
I’ve also thought about using another view count plugin that support Rest Api out of the box and just change the post meta key in the database to fit the new format of the plugin that support rest api. Is it a good idea?
thanks for your help
Leave an answer