SlideShare a Scribd company logo
Jonathan Bossenger
Let’s Code
Learn.WordPress.org
Using the WordPress REST API
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 admin-ajax example plugin
• https://github.com/jonathanbossenger/wp-learn-
rest-api/releases/download/0.0.1/wp-learn-rest-
api.0.0.1.zip
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
○ @jon_bossenger in Twitter
Learn.WordPress.org
Let's code!
Using the
WordPress REST
API
Jonathan Bossenger
Announcements
○ Welcome, and thanks to Thelma for co-hosting!
○ We are presenting in focus mode, but please feel free to enable your video.
○ 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.1/wp-
learn-rest-api.0.0.1.zip
○ 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/
Learning Outcomes
1. Using the WordPress REST API (aka WP REST API)
• What is the WP REST API
2. All about Routes and Endpoints
3. Using Global Parameters
• Limiting fields
• Implementing Pagination and Ordering
4. WP REST API Authentication overview
5. Using the WP REST API in a WordPress plugin
Objectives 1
1. Setup and review the example plugin
2. Learn what the words REST and API mean
3. Understand the difference between an endpoint and a route
4. Learn how to alter REST API response data
5. Update the example plugin to replace the admin-ajax with a REST API call
7
8
Let’s code.
Resources
○ https://github.com/jonathanbossenger/wp-learn-rest-api/releases/download/0.0.1/wp-learn-rest-api.0.0.1.zip
○ https://github.com/jonathanbossenger/wp-learn-rest-api/
○ https://developer.wordpress.org/rest-api/
○ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const
○ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach

More Related Content

PPTX
Interacting with the WP REST API
PPTX
WP REST API Authentication, custom fields and updating resources
PPTX
Let's code: extending the WP REST API - modifying responses
PPTX
WordPress Plugin Security
PPTX
Developing Blocks without React - Block Supports.pptx
PPTX
Let's code: custom content & custom capabilities
PPTX
Let's code: developing WordPress User Roles and Capabilities
PPTX
Debugging in WordPress
Interacting with the WP REST API
WP REST API Authentication, custom fields and updating resources
Let's code: extending the WP REST API - modifying responses
WordPress Plugin Security
Developing Blocks without React - Block Supports.pptx
Let's code: custom content & custom capabilities
Let's code: developing WordPress User Roles and Capabilities
Debugging in WordPress

Similar to Using the WP REST API (20)

PPTX
Testing plugins for PHP 8
PPTX
Preventing CSRF Security Vulnerabilities.pptx
PPTX
Preventing Common Security Vulnerabilities
PPTX
Let's code: WordPress multisite experiments
PPTX
Developing for multisite
PPTX
Let's code_ WP REST API - custom routes and endpoints.pptx
PPTX
Help test WordPress - developer edition
PPTX
Developing Blocks without React - Controls.pptx
PPTX
Let's code! Converting a Shortcode into a Block
PPTX
Common WordPress APIs - Dashboard Widgets
PPTX
Using Block Patterns in your Block Theme.pptx
PPTX
Developing Blocks without React - Part 1
PPTX
Common WordPress APIs: Metadata
PPTX
Common WordPress APIs_ Settings API
PPTX
Common WordPress APIs_ Internationalization
PPTX
Developing Blocks without React - Attributes.pptx
PPTX
Internationalisation in Block Themes.pptx
PPTX
Developing Blocks without React - Part 2
PPTX
Developing Blocks without React - Part 2.pptx
PPTX
Common WordPress APIs - Options API
Testing plugins for PHP 8
Preventing CSRF Security Vulnerabilities.pptx
Preventing Common Security Vulnerabilities
Let's code: WordPress multisite experiments
Developing for multisite
Let's code_ WP REST API - custom routes and endpoints.pptx
Help test WordPress - developer edition
Developing Blocks without React - Controls.pptx
Let's code! Converting a Shortcode into a Block
Common WordPress APIs - Dashboard Widgets
Using Block Patterns in your Block Theme.pptx
Developing Blocks without React - Part 1
Common WordPress APIs: Metadata
Common WordPress APIs_ Settings API
Common WordPress APIs_ Internationalization
Developing Blocks without React - Attributes.pptx
Internationalisation in Block Themes.pptx
Developing Blocks without React - Part 2
Developing Blocks without React - Part 2.pptx
Common WordPress APIs - Options 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_ HTTP API.pptx
PPTX
What’s new for developers_ (August 2023).pptx
PPTX
Testing your plugins for PHP version compatibility
PPTX
Common WordPress APIs_ Global Variables
PPTX
Testing WordPress 6.3 - Developer edition
PPTX
Common WordPress APIs: Responsive Images
PPTX
Custom Tables in WordPress
PPTX
The WordPress Database
PPTX
WordPress Coding Standards
PPTX
Managing a WordPress Multisite Network
PPTX
Introduction to WordPress Multisite Networks
PPTX
Custom Post Types and Capabilities.pptx
PPTX
Developing WordPress User Roles and Capabilities
PPTX
Creating a WordPress multisite network
PPTX
Extending WordPress: common security vulnerabilities
PPTX
WP REST API - custom routes and endpoints
New WordPress Developer APIs The Interactivity API
The WordPress HTML API
The WordPress Create Block tool
PHP compatibility testing with PHPCompatibilityWP
Common WordPress APIs_ HTTP API.pptx
What’s new for developers_ (August 2023).pptx
Testing your plugins for PHP version compatibility
Common WordPress APIs_ Global Variables
Testing WordPress 6.3 - Developer edition
Common WordPress APIs: Responsive Images
Custom Tables in WordPress
The WordPress Database
WordPress Coding Standards
Managing a WordPress Multisite Network
Introduction to WordPress Multisite Networks
Custom Post Types and Capabilities.pptx
Developing WordPress User Roles and Capabilities
Creating a WordPress multisite network
Extending WordPress: common security vulnerabilities
WP REST API - custom routes and endpoints
Ad

Recently uploaded (20)

PPTX
MYSQL Presentation for SQL database connectivity
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Electronic commerce courselecture one. Pdf
PPTX
A Presentation on Artificial Intelligence
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Empathic Computing: Creating Shared Understanding
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
cuic standard and advanced reporting.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Assigned Numbers - 2025 - Bluetooth® Document
MYSQL Presentation for SQL database connectivity
Agricultural_Statistics_at_a_Glance_2022_0.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Electronic commerce courselecture one. Pdf
A Presentation on Artificial Intelligence
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Empathic Computing: Creating Shared Understanding
Advanced methodologies resolving dimensionality complications for autism neur...
Chapter 3 Spatial Domain Image Processing.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
“AI and Expert System Decision Support & Business Intelligence Systems”
cuic standard and advanced reporting.pdf
Spectral efficient network and resource selection model in 5G networks
Programs and apps: productivity, graphics, security and other tools
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Review of recent advances in non-invasive hemoglobin estimation
Assigned Numbers - 2025 - Bluetooth® Document

Using the WP REST API

  • 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 admin-ajax example plugin • https://github.com/jonathanbossenger/wp-learn- rest-api/releases/download/0.0.1/wp-learn-rest- api.0.0.1.zip 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 ○ @jon_bossenger in Twitter
  • 4. Announcements ○ Welcome, and thanks to Thelma for co-hosting! ○ We are presenting in focus mode, but please feel free to enable your video. ○ 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.1/wp- learn-rest-api.0.0.1.zip ○ 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/
  • 6. Learning Outcomes 1. Using the WordPress REST API (aka WP REST API) • What is the WP REST API 2. All about Routes and Endpoints 3. Using Global Parameters • Limiting fields • Implementing Pagination and Ordering 4. WP REST API Authentication overview 5. Using the WP REST API in a WordPress plugin
  • 7. Objectives 1 1. Setup and review the example plugin 2. Learn what the words REST and API mean 3. Understand the difference between an endpoint and a route 4. Learn how to alter REST API response data 5. Update the example plugin to replace the admin-ajax with a REST API call 7
  • 9. Resources ○ https://github.com/jonathanbossenger/wp-learn-rest-api/releases/download/0.0.1/wp-learn-rest-api.0.0.1.zip ○ https://github.com/jonathanbossenger/wp-learn-rest-api/ ○ https://developer.wordpress.org/rest-api/ ○ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const ○ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach

Editor's Notes

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