Closed mjgchase closed 5 years ago
Hi there,
Hard to say what's going on with just "it doesn't work." You'll need to provide some more details if you want to get help.
For the time being, please try checking these two FAQs:
If none of those help, then please:
Hi Cabrerahector
When making calls to the rest api endpoint detailed here https://developer.wordpress.org/rest-api/reference/posts/, you can make calls by ID to get a specific post or by slugs , this does not seem to register through your plugin
Hope that clarifies it for you.
Thanks for clarifying.
Indeed, as you already noticed the plugin doesn't update the views count of a post when pulling its data via REST API. This use case wasn't contemplated when REST API support was first added into the plugin and right now you're the first person to ask about it. I had no idea people would want this to be honest.
There's however an endpoint the plugin uses to update the views count that's publicly available: /wp-json/wordpress-popular-posts/v1/popular-posts/
. Sending a POST
request to that route with the right parameters (I'm not near a computer right now, please check the source code of the WPP's REST API controller for more details) will do the job. There might be a more elegant solution but, again, I'm not near a computer right now to play around with the REST API.
Posting to that and point with wpp_id equal to the word press post id works , thanks much appreciated
The plugin seems to not register post views that are requested through the REST API