SlideShare a Scribd company logo
Jonathan Bossenger
Let’s Code
Learn.WordPress.org
Extending the WP REST API - modifying responses
2
👋🏽
Welcome!
As you join, please make sure you have your local
development environment ready:
• A local WordPress installation
• A code editor like VSCode or Sublime
• The example plugin
• https://github.com/jonathanbossenger/wp-
learn-rest-api/releases/download/0.0.4/wp-
learn-rest-api.0.0.4.zip
• Postman
https://www.postman.com/downloads/
Then, let everyone know in the chat where you’re
joining us from…
Hello!
○ My name is Jonathan Bossenger
○ From Cape Town, South Africa
○ Ex-developer turned code instructor
○ Sponsored contributor at Automattic
○ jonathanbossenger.com
Learn.WordPress.org
Let's code!
The WP REST API -
modifying responses
Jonathan Bossenger
Announcements
○ Welcome, and thank you to Mark for co-hosting!
○ We are presenting in focus mode, but please feel free to enable your video.
○ Please let me know if you can’t see this slide.
○ You are welcome to ask questions.
○ You are welcome to post questions in the chat, or unmute to ask questions.
Announcements
○ Make sure your local install is ready
• https://github.com/jonathanbossenger/wp-learn-rest-
api/releases/download/0.0.4/wp-learn-rest-api.0.0.4.zip
• https://www.postman.com/downloads/
○ If I am going too fast, please let me know!
○ We will be posting this session to https://wordpress.tv/ afterwards
○ For more WordPress focused content please visit https://learn.wordpress.org/
○ Follow up questions/feedback - https://github.com/WordPress/Learn/issues/1283
Learning Outcomes
1. Learn the different ways to add custom fields to the WP REST API
2. Enable custom meta fields for a WP REST API route
3. Add custom top level fields to a WP REST API route
4. Learn about REST API schema
Objectives
1. Setup and review the example plugin code so far
2. Set up and test some API routes using Postman
3. Enable a custom field using register_meta
4. Add a custom field using register_rest_field
5. Add field schema to the custom field
7
8
Let’s code.
Resources
○ https://github.com/WordPress/Learn/issues/1283
○ https://github.com/jonathanbossenger/wp-learn-rest-api/releases/download/0.0.4/wp-learn-rest-
api.0.0.4.zip
○ https://www.postman.com/downloads/
○ https://developer.wordpress.org/rest-api/extending-the-rest-api/modifying-responses/
○ https://developer.wordpress.org/rest-api/using-the-rest-api/global-parameters/#_fields
○ https://developer.wordpress.org/reference/functions/register_meta/
○ https://developer.wordpress.org/reference/functions/register_rest_field/

More Related Content

PPTX
Using the WP REST API
PPTX
WP REST API Authentication, custom fields and updating resources
PPTX
Interacting with the WP REST API
PPTX
Let's code_ WP REST API - custom routes and endpoints.pptx
PPTX
WordPress Rest API
PDF
2019 WordCamp Orange County - An Introduction to the WordPress REST API
PPTX
Using the WordPress REST API
PDF
Extending the WordPress REST API - Josh Pollock
Using the WP REST API
WP REST API Authentication, custom fields and updating resources
Interacting with the WP REST API
Let's code_ WP REST API - custom routes and endpoints.pptx
WordPress Rest API
2019 WordCamp Orange County - An Introduction to the WordPress REST API
Using the WordPress REST API
Extending the WordPress REST API - Josh Pollock

Similar to Let's code: extending the WP REST API - modifying responses (20)

PPTX
Word press rest api sudarshan shrestha
PDF
JSON REST API for WordPress
PDF
Wp JSON API and You!
PDF
WordPress REST API hacking
PDF
WordCamp Wilmington 2017 WP-API Why?
PDF
JSON REST API for WordPress
PDF
WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!
PDF
Using the new WordPress REST API
PDF
Introduction to WordPress Rest API
PDF
WordPress REST API hacking
PPTX
The JSON REST API for WordPress
PDF
WordCamp Raleigh 2016 - WP API, What is it good for? Absolutely Everything!
PDF
Getting Started With WP REST API
PDF
WP REST API - Adding Your Own Endpoint
PDF
Old WP REST API, New Tricks
PDF
What the WordPress REST API Means for Javascript Developers
PDF
WORDPRESS_REST_API_WORDPRESS_REST_API.pdf
PPTX
WP REST API - Building a simple Web Application
PPTX
Building native mobile apps with word press
PDF
Building a mini-theme with WordPress REST API
Word press rest api sudarshan shrestha
JSON REST API for WordPress
Wp JSON API and You!
WordPress REST API hacking
WordCamp Wilmington 2017 WP-API Why?
JSON REST API for WordPress
WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!
Using the new WordPress REST API
Introduction to WordPress Rest API
WordPress REST API hacking
The JSON REST API for WordPress
WordCamp Raleigh 2016 - WP API, What is it good for? Absolutely Everything!
Getting Started With WP REST API
WP REST API - Adding Your Own Endpoint
Old WP REST API, New Tricks
What the WordPress REST API Means for Javascript Developers
WORDPRESS_REST_API_WORDPRESS_REST_API.pdf
WP REST API - Building a simple Web Application
Building native mobile apps with word press
Building a mini-theme with WordPress REST API
Ad

More from Jonathan Bossenger (20)

PPTX
New WordPress Developer APIs The Interactivity API
PPTX
The WordPress HTML API
PPTX
The WordPress Create Block tool
PPTX
PHP compatibility testing with PHPCompatibilityWP
PPTX
Common WordPress APIs_ Settings API
PPTX
Common WordPress APIs - Options API
PPTX
Common WordPress APIs_ HTTP API.pptx
PPTX
Common WordPress APIs: Metadata
PPTX
What’s new for developers_ (August 2023).pptx
PPTX
Testing your plugins for PHP version compatibility
PPTX
Common WordPress APIs_ Global Variables
PPTX
Common WordPress APIs_ Internationalization
PPTX
Testing WordPress 6.3 - Developer edition
PPTX
Common WordPress APIs: Responsive Images
PPTX
Common WordPress APIs - Dashboard Widgets
PPTX
Custom Tables in WordPress
PPTX
The WordPress Database
PPTX
WordPress Coding Standards
PPTX
Managing a WordPress Multisite Network
PPTX
Debugging in WordPress
New WordPress Developer APIs The Interactivity API
The WordPress HTML API
The WordPress Create Block tool
PHP compatibility testing with PHPCompatibilityWP
Common WordPress APIs_ Settings API
Common WordPress APIs - Options API
Common WordPress APIs_ HTTP API.pptx
Common WordPress APIs: Metadata
What’s new for developers_ (August 2023).pptx
Testing your plugins for PHP version compatibility
Common WordPress APIs_ Global Variables
Common WordPress APIs_ Internationalization
Testing WordPress 6.3 - Developer edition
Common WordPress APIs: Responsive Images
Common WordPress APIs - Dashboard Widgets
Custom Tables in WordPress
The WordPress Database
WordPress Coding Standards
Managing a WordPress Multisite Network
Debugging in WordPress
Ad

Recently uploaded (20)

PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Unlocking AI with Model Context Protocol (MCP)
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
sap open course for s4hana steps from ECC to s4
PDF
A comparative analysis of optical character recognition models for extracting...
PPTX
Cloud computing and distributed systems.
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
cuic standard and advanced reporting.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Empathic Computing: Creating Shared Understanding
Digital-Transformation-Roadmap-for-Companies.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Programs and apps: productivity, graphics, security and other tools
Unlocking AI with Model Context Protocol (MCP)
The AUB Centre for AI in Media Proposal.docx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
The Rise and Fall of 3GPP – Time for a Sabbatical?
Reach Out and Touch Someone: Haptics and Empathic Computing
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
sap open course for s4hana steps from ECC to s4
A comparative analysis of optical character recognition models for extracting...
Cloud computing and distributed systems.
MYSQL Presentation for SQL database connectivity
Dropbox Q2 2025 Financial Results & Investor Presentation
Review of recent advances in non-invasive hemoglobin estimation
MIND Revenue Release Quarter 2 2025 Press Release
cuic standard and advanced reporting.pdf

Let's code: extending the WP REST API - modifying responses

  • 2. 2 👋🏽 Welcome! As you join, please make sure you have your local development environment ready: • A local WordPress installation • A code editor like VSCode or Sublime • The example plugin • https://github.com/jonathanbossenger/wp- learn-rest-api/releases/download/0.0.4/wp- learn-rest-api.0.0.4.zip • Postman https://www.postman.com/downloads/ Then, let everyone know in the chat where you’re joining us from… Hello! ○ My name is Jonathan Bossenger ○ From Cape Town, South Africa ○ Ex-developer turned code instructor ○ Sponsored contributor at Automattic ○ jonathanbossenger.com
  • 3. Learn.WordPress.org Let's code! The WP REST API - modifying responses Jonathan Bossenger
  • 4. Announcements ○ Welcome, and thank you to Mark for co-hosting! ○ We are presenting in focus mode, but please feel free to enable your video. ○ Please let me know if you can’t see this slide. ○ You are welcome to ask questions. ○ You are welcome to post questions in the chat, or unmute to ask questions.
  • 5. Announcements ○ Make sure your local install is ready • https://github.com/jonathanbossenger/wp-learn-rest- api/releases/download/0.0.4/wp-learn-rest-api.0.0.4.zip • https://www.postman.com/downloads/ ○ If I am going too fast, please let me know! ○ We will be posting this session to https://wordpress.tv/ afterwards ○ For more WordPress focused content please visit https://learn.wordpress.org/ ○ Follow up questions/feedback - https://github.com/WordPress/Learn/issues/1283
  • 6. Learning Outcomes 1. Learn the different ways to add custom fields to the WP REST API 2. Enable custom meta fields for a WP REST API route 3. Add custom top level fields to a WP REST API route 4. Learn about REST API schema
  • 7. Objectives 1. Setup and review the example plugin code so far 2. Set up and test some API routes using Postman 3. Enable a custom field using register_meta 4. Add a custom field using register_rest_field 5. Add field schema to the custom field 7
  • 9. Resources ○ https://github.com/WordPress/Learn/issues/1283 ○ https://github.com/jonathanbossenger/wp-learn-rest-api/releases/download/0.0.4/wp-learn-rest- api.0.0.4.zip ○ https://www.postman.com/downloads/ ○ https://developer.wordpress.org/rest-api/extending-the-rest-api/modifying-responses/ ○ https://developer.wordpress.org/rest-api/using-the-rest-api/global-parameters/#_fields ○ https://developer.wordpress.org/reference/functions/register_meta/ ○ https://developer.wordpress.org/reference/functions/register_rest_field/

Editor's Notes

  • #2: TITLE SLIDE: Make a copy of this presentation to your Google Drive, and edit to replace with your details.