WordPress / Learn

WordPress.org Learn - The canonical source for the code and content behind https://learn.WordPress.org
276 stars 101 forks source link

Tutorial - WP REST API modifying responses #1361

Closed jonathanbossenger closed 1 year ago

jonathanbossenger commented 1 year ago

Topic Description

The WordPress REST API provides an interface for applications to interact with your WordPress site by sending and receiving data as JSON (JavaScript Object Notation) objects. By default, it provides REST endpoints (URLs) representing the posts, pages, taxonomies, and other built-in WordPress data types. Your application can send and receive JSON data to these endpoints to query, modify and create content on your site. However, it is also possible to extend the WP REST API, in order to perform specific actions that are outside of the scope of the default routes and endpoints. In this session, you will learn about one of the ways you can extend the WP REST API, by modifying REST responses.

Related Resources

Links to related content on Learn, HelpHub, DevHub, GitHub Gutenberg Issues, DevNotes, etc.

Guidelines

Review the team guidelines

Tutorial Development Checklist

jonathanbossenger commented 1 year ago

Script: https://github.com/jonathanbossenger/wp-content/blob/main/tutorials/wp-rest-api-04-modifying-responses.md

jonathanbossenger commented 1 year ago

Tutorial ready for review

https://user-images.githubusercontent.com/180629/220912851-fc7621d7-53cb-41a8-b406-1ce406361f63.mp4

Note to reviewers:

nomad-skateboarding-dev commented 1 year ago

As per usual, this is a non-developer review. However, you do such a good job on these tutorials, Jonathan, that I'll be changing my developer label soon! Great job! 🥇

Specific Feedback

courtneyr-dev commented 1 year ago

Watching the video in GitHub's width leaves me wanting to zoom in more to see the sidebars and top nav buttons in Postman. If the video player is rather small, exaggerating zoom to stop before mobile breakpoints tends to be my preference.

Same notices about the audio. It sounds like a background sound removal tool over-processed those areas.

The content is fantastic though.

jonathanbossenger commented 1 year ago

Thanks for the feedback folks

3:58 Volume drops by half and is distorted. 4:41 - 4:51 it sounds like all sound dropped? But you could just be pausing as you're typing the example?

Yeah I was experimenting with sound removal tools on this video, this one didn't seem to turn out great. I'll upload a better version shortly.

Watching the video in GitHub's width leaves me wanting to zoom in more to see the sidebars and top nav buttons in Postman. If the video player is rather small, exaggerating zoom to stop before mobile breakpoints tends to be my preference.

The difficulty, especially with an app like Postman, is the more you Zoom in, the less space you have to show the various panels of data. I'm currently at a +2 zoom (whatever that works out to on an electron app, I have no way to check) and if I go a level higher, it's difficult to see the full response on screen.

jonathanbossenger commented 1 year ago

Updated video with better audio

https://user-images.githubusercontent.com/180629/222927129-512ee415-97cd-44f9-9fd7-fd4acd2f038e.mp4

nomad-skateboarding-dev commented 1 year ago

This sounds fantastic @jonathanbossenger . Well done. 🙂

jonathanbossenger commented 1 year ago

https://learn.wordpress.org/tutorial/wordpress-rest-api-modifying-responses/