“Unlock the Future of Web Development: Discover the Hidden Powers of Headless WordPress!”

"Unlock the Future of Web Development: Discover the Hidden Powers of Headless WordPress!"
A query to fetch a post, its author with the name and avatar image URL

A similar call to /wp-json/wp/v2/posts?slug=hello-world will give us many more fields. As you can see below, while the REST API does give us the author ID, we cannot get the avatar URL by default from the same request.

A call to the WordPress REST API in a terminal showing the output that excludes author avatar URL

On the other hand, the WordPress REST API is supported out of the box, with no configuration needed. This has led to a larger ecosystem where plugins provide their endpoints via the WordPress REST API (one example is WooCommerce).

I encourage you to check out both and see which will work better for your project.

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

You May Have Missed