Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extending the WordPress REST API #2268

Closed
Tracked by #1984
jonathanbossenger opened this issue Feb 29, 2024 · 11 comments
Closed
Tracked by #1984

Extending the WordPress REST API #2268

jonathanbossenger opened this issue Feb 29, 2024 · 11 comments
Assignees
Labels
[Content] Published Marks closed issues as content that was actually published.

Comments

@jonathanbossenger
Copy link
Collaborator

jonathanbossenger commented Feb 29, 2024

Details

  • Content type (Online Workshop, Lesson, Course, Tutorial, or Lesson Plan): Lesson
  • Content title: Extending the WP REST API
  • Topic description: This lesson will introduce two methods of adding fields to REST API requests, either by enabling custom fields in the REST API route, or by making custom fields available as top level fields, as well as the pros and cons of both approaches.
  • Audience (User, Developer, Designer, Contributor, etc.): Developer
  • Experience Level (Beginner, Intermediate, Advanced, Any): Beginnner

Learning Objectives

  • Register post meta for a custom post type that supports the WP REST API
  • Add or update a custom post type via the WP REST API including this custom post meta
  • Modify the custom post meta by moving it to a top-level field on the WP REST API endpoint

Related Resources and Other Notes

Automation Code

//lesson

Copy link
Contributor

github-actions bot commented Mar 17, 2024

Lesson Development Checklist

  • Gather any relevant links to Support, Docs, or related material
  • Description and Objectives finalized
  • Lesson created and announced to the team for review
  • Lesson reviewed
  • Lesson video submitted and published to WPTV
  • Lesson created on Learn.WordPress.org
  • Lesson video published to YouTube
  • Lesson on Learn.WordPress.org updated with YouTube video
  • Lesson published to Learn.WordPress.org

@jonathanbossenger jonathanbossenger moved this from 🚧 Drafts in Progress to 🔎 Ready for Review in LearnWP Content - Development Mar 28, 2024
@jonathanbossenger
Copy link
Collaborator Author

04.Extending.the.WordPress.REST.API.mp4

Video ready for review

Please follow the Guidelines for reviewing content to review this lesson.

@ironnysh
Copy link

ironnysh commented Apr 2, 2024

Tutorial/Lessons Review Checklist

  • Learning outcomes/objectives are clear.
  • Technical concepts introduced in the content are accurate.
  • The speed of demonstrations are easy to follow.
  • The narration audio matches what is shown visually.
  • Spelling and grammar are correct.
  • Sound quality is consistent throughout the video.
  • Brand Usage Guidelines and Promotional Guidelines are being followed.
  • Media assets are all in the public domain (CC0).

Lots of good stuff here :-)

  • It might be worth mentioning that show_in_rest is required if you want to view the custom field in the editor.
  • At 7:31, when you switch to the editor, the custom fields are already displayed below the main window, but this isn't the default behavior. It would be nice to show how to enable it.
  • At 7:37, there's a little repetition: "It's also..."

@jonathanbossenger
Copy link
Collaborator Author

@ironnysh thanks for the review

the custom fields are already displayed below the main window, but this isn't the default behavior. It would be nice to show how to enable it.

This is covered in the Introduction to plugins lesson on custom fields

At 7:37, there's a little repetition: "It's also..."

Good catch, thanks.

@jonathanbossenger
Copy link
Collaborator Author

Updated video

04.Extending.the.WordPress.REST.API.mp4

@ironnysh
Copy link

ironnysh commented Apr 5, 2024

This is covered in the Introduction to plugins lesson on custom fields

@jonathanbossenger, but what if people don't follow the linear path? :-)

BTW, there's been a change in 6.5, so this line should be updated:

image

@jonathanbossenger
Copy link
Collaborator Author

BTW, there's been a change in 6.5, so [this line](https://github.com/jonathanbossenger/wp-content/blob/e1aebbf4b4362cb24ec9f8a35da3675303e3e403/developer-learning-pathway/06-introduction-to-wordpress-plugins/05-custom-post-type-data.md?plain=1#L45) should be updated:

Yeah, I saw that. I'll probably circle back and update that lesson once the full learning pathway is completed.

@jonathanbossenger
Copy link
Collaborator Author

@jonathanbossenger
Copy link
Collaborator Author

@jonathanbossenger
Copy link
Collaborator Author

//publish

@github-actions github-actions bot added the [Content] Published Marks closed issues as content that was actually published. label May 11, 2024
@github-project-automation github-project-automation bot moved this from 🔎 Ready for Review to 📜 Published or Closed in LearnWP Content - Development May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Content] Published Marks closed issues as content that was actually published.
Projects
Status: 📜 Published or Closed
Development

No branches or pull requests

2 participants