WordPress REST API, Get Random Post endpoint
In the following snippet, you can register a new endpoint in the API to access random posts. This can be configuring to work with any post-type. You’ll just updating the get_posts array accordingly. Enjoy! You’ll want to put this inside your functions.php inside your Theme, or create a plugin. If you’re extending the WordPress REST API … Continued