SlideShare a Scribd company logo
Jonathan Bossenger
Let’s Code
Learn.WordPress.org
Extending the WP REST API - custom routes &
endpoints
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
• Postman
https://www.postman.com/downloads/
Then, let everyone know in the chat where you’re
joining us from, and something interesting about your
city/state/country…
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 -
custom routes and
endpoints
Jonathan Bossenger
Announcements
○ Welcome, and thank you to Joshua 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 my shared screen.
○ 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://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/1304
Learning Outcomes
1. Registering a custom WP REST API route
2. Registering different route endpoints
3. How to access WP REST API request data in your custom route
4. Protecting routes/requiring authentication
5. Adding and using path variables on routes
Objectives
1. Create a form submissions REST API plugin
2. Create a custom table to store form submissions
3. Register a custom WP REST API route to fetch submissions
4. Register a custom WP REST API route to post submissions
5. Register a custom WP REST API endpoint to fetch a single submission
7
8
Let’s code.
Resources
○ https://github.com/WordPress/Learn/issues/1304
○ https://www.postman.com/downloads/
○ https://developer.wordpress.org/rest-api/extending-the-rest-api/adding-custom-endpoints/
○ https://developer.wordpress.org/rest-api/extending-the-rest-api/routes-and-endpoints/
○ https://developer.wordpress.org/reference/functions/dbdelta/
○ https://developer.wordpress.org/reference/functions/register_rest_route/
○ https://developer.wordpress.org/reference/functions/register_activation_hook/
○ https://developer.wordpress.org/reference/functions/current_user_can/
○ https://github.com/CastosHQ/Seriously-Simple-Podcasting/tree/master/php/classes/rest

More Related Content

Similar to Let's code_ WP REST API - custom routes and endpoints.pptx

Let's code: developing WordPress User Roles and Capabilities
Let's code: developing WordPress User Roles and CapabilitiesLet's code: developing WordPress User Roles and Capabilities
Let's code: developing WordPress User Roles and Capabilities
Jonathan Bossenger
 
Help test WordPress - developer edition
Help test WordPress - developer editionHelp test WordPress - developer edition
Help test WordPress - developer edition
Jonathan Bossenger
 
Developing Blocks without React - Block Supports.pptx
Developing Blocks without React - Block Supports.pptxDeveloping Blocks without React - Block Supports.pptx
Developing Blocks without React - Block Supports.pptx
Jonathan Bossenger
 
Let's code: custom content & custom capabilities
Let's code: custom content & custom capabilitiesLet's code: custom content & custom capabilities
Let's code: custom content & custom capabilities
Jonathan Bossenger
 
Common WordPress APIs - Dashboard Widgets
Common WordPress APIs - Dashboard WidgetsCommon WordPress APIs - Dashboard Widgets
Common WordPress APIs - Dashboard Widgets
Jonathan Bossenger
 
Developing Blocks without React - Controls.pptx
Developing Blocks without React - Controls.pptxDeveloping Blocks without React - Controls.pptx
Developing Blocks without React - Controls.pptx
Jonathan Bossenger
 
Debugging in WordPress
Debugging in WordPressDebugging in WordPress
Debugging in WordPress
Jonathan Bossenger
 
WordPress Melbourne User Group May 2013 Developers Meetup
WordPress Melbourne User Group May 2013 Developers MeetupWordPress Melbourne User Group May 2013 Developers Meetup
WordPress Melbourne User Group May 2013 Developers Meetup
James Collins
 
Developing for multisite
Developing for multisiteDeveloping for multisite
Developing for multisite
Jonathan Bossenger
 
WordPress Plugin Security
WordPress Plugin SecurityWordPress Plugin Security
WordPress Plugin Security
Jonathan Bossenger
 
Common WordPress APIs: Metadata
Common WordPress APIs: MetadataCommon WordPress APIs: Metadata
Common WordPress APIs: Metadata
Jonathan Bossenger
 
Global Styles Variations in Block Themes.pptx
Global Styles Variations in Block Themes.pptxGlobal Styles Variations in Block Themes.pptx
Global Styles Variations in Block Themes.pptx
Jonathan Bossenger
 
Developing Blocks without React - Part 2.pptx
Developing Blocks without React - Part 2.pptxDeveloping Blocks without React - Part 2.pptx
Developing Blocks without React - Part 2.pptx
Jonathan Bossenger
 
WordPress Coding Standards
WordPress Coding StandardsWordPress Coding Standards
WordPress Coding Standards
Jonathan Bossenger
 
Developing Blocks without React - Part 2
Developing Blocks without React - Part 2Developing Blocks without React - Part 2
Developing Blocks without React - Part 2
Jonathan Bossenger
 
Developing Blocks without React - Part 1
Developing Blocks without React - Part 1Developing Blocks without React - Part 1
Developing Blocks without React - Part 1
Jonathan Bossenger
 
Using Block Patterns in your Block Theme.pptx
Using Block Patterns in your Block Theme.pptxUsing Block Patterns in your Block Theme.pptx
Using Block Patterns in your Block Theme.pptx
Jonathan Bossenger
 
Common WordPress APIs_ Internationalization
Common WordPress APIs_ InternationalizationCommon WordPress APIs_ Internationalization
Common WordPress APIs_ Internationalization
Jonathan Bossenger
 
Developing Blocks without React - Attributes.pptx
Developing Blocks without React - Attributes.pptxDeveloping Blocks without React - Attributes.pptx
Developing Blocks without React - Attributes.pptx
Jonathan Bossenger
 
Internationalisation in Block Themes.pptx
Internationalisation in Block Themes.pptxInternationalisation in Block Themes.pptx
Internationalisation in Block Themes.pptx
Jonathan Bossenger
 

Similar to Let's code_ WP REST API - custom routes and endpoints.pptx (20)

Let's code: developing WordPress User Roles and Capabilities
Let's code: developing WordPress User Roles and CapabilitiesLet's code: developing WordPress User Roles and Capabilities
Let's code: developing WordPress User Roles and Capabilities
 
Help test WordPress - developer edition
Help test WordPress - developer editionHelp test WordPress - developer edition
Help test WordPress - developer edition
 
Developing Blocks without React - Block Supports.pptx
Developing Blocks without React - Block Supports.pptxDeveloping Blocks without React - Block Supports.pptx
Developing Blocks without React - Block Supports.pptx
 
Let's code: custom content & custom capabilities
Let's code: custom content & custom capabilitiesLet's code: custom content & custom capabilities
Let's code: custom content & custom capabilities
 
Common WordPress APIs - Dashboard Widgets
Common WordPress APIs - Dashboard WidgetsCommon WordPress APIs - Dashboard Widgets
Common WordPress APIs - Dashboard Widgets
 
Developing Blocks without React - Controls.pptx
Developing Blocks without React - Controls.pptxDeveloping Blocks without React - Controls.pptx
Developing Blocks without React - Controls.pptx
 
Debugging in WordPress
Debugging in WordPressDebugging in WordPress
Debugging in WordPress
 
WordPress Melbourne User Group May 2013 Developers Meetup
WordPress Melbourne User Group May 2013 Developers MeetupWordPress Melbourne User Group May 2013 Developers Meetup
WordPress Melbourne User Group May 2013 Developers Meetup
 
Developing for multisite
Developing for multisiteDeveloping for multisite
Developing for multisite
 
WordPress Plugin Security
WordPress Plugin SecurityWordPress Plugin Security
WordPress Plugin Security
 
Common WordPress APIs: Metadata
Common WordPress APIs: MetadataCommon WordPress APIs: Metadata
Common WordPress APIs: Metadata
 
Global Styles Variations in Block Themes.pptx
Global Styles Variations in Block Themes.pptxGlobal Styles Variations in Block Themes.pptx
Global Styles Variations in Block Themes.pptx
 
Developing Blocks without React - Part 2.pptx
Developing Blocks without React - Part 2.pptxDeveloping Blocks without React - Part 2.pptx
Developing Blocks without React - Part 2.pptx
 
WordPress Coding Standards
WordPress Coding StandardsWordPress Coding Standards
WordPress Coding Standards
 
Developing Blocks without React - Part 2
Developing Blocks without React - Part 2Developing Blocks without React - Part 2
Developing Blocks without React - Part 2
 
Developing Blocks without React - Part 1
Developing Blocks without React - Part 1Developing Blocks without React - Part 1
Developing Blocks without React - Part 1
 
Using Block Patterns in your Block Theme.pptx
Using Block Patterns in your Block Theme.pptxUsing Block Patterns in your Block Theme.pptx
Using Block Patterns in your Block Theme.pptx
 
Common WordPress APIs_ Internationalization
Common WordPress APIs_ InternationalizationCommon WordPress APIs_ Internationalization
Common WordPress APIs_ Internationalization
 
Developing Blocks without React - Attributes.pptx
Developing Blocks without React - Attributes.pptxDeveloping Blocks without React - Attributes.pptx
Developing Blocks without React - Attributes.pptx
 
Internationalisation in Block Themes.pptx
Internationalisation in Block Themes.pptxInternationalisation in Block Themes.pptx
Internationalisation in Block Themes.pptx
 

More from Jonathan Bossenger

New WordPress Developer APIs The Interactivity API
New WordPress Developer APIs The Interactivity APINew WordPress Developer APIs The Interactivity API
New WordPress Developer APIs The Interactivity API
Jonathan Bossenger
 
The WordPress HTML API
The WordPress HTML APIThe WordPress HTML API
The WordPress HTML API
Jonathan Bossenger
 
The WordPress Create Block tool
The WordPress Create Block toolThe WordPress Create Block tool
The WordPress Create Block tool
Jonathan Bossenger
 
PHP compatibility testing with PHPCompatibilityWP
PHP compatibility testing with PHPCompatibilityWPPHP compatibility testing with PHPCompatibilityWP
PHP compatibility testing with PHPCompatibilityWP
Jonathan Bossenger
 
Common WordPress APIs_ Settings API
Common WordPress APIs_ Settings APICommon WordPress APIs_ Settings API
Common WordPress APIs_ Settings API
Jonathan Bossenger
 
Common WordPress APIs - Options API
Common WordPress APIs - Options APICommon WordPress APIs - Options API
Common WordPress APIs - Options API
Jonathan Bossenger
 
What’s new for developers_ (August 2023).pptx
What’s new for developers_ (August 2023).pptxWhat’s new for developers_ (August 2023).pptx
What’s new for developers_ (August 2023).pptx
Jonathan Bossenger
 
Testing your plugins for PHP version compatibility
Testing your plugins for PHP version compatibilityTesting your plugins for PHP version compatibility
Testing your plugins for PHP version compatibility
Jonathan Bossenger
 
Common WordPress APIs_ Global Variables
Common WordPress APIs_ Global VariablesCommon WordPress APIs_ Global Variables
Common WordPress APIs_ Global Variables
Jonathan Bossenger
 
Testing WordPress 6.3 - Developer edition
Testing WordPress 6.3 - Developer editionTesting WordPress 6.3 - Developer edition
Testing WordPress 6.3 - Developer edition
Jonathan Bossenger
 
Common WordPress APIs: Responsive Images
Common WordPress APIs: Responsive ImagesCommon WordPress APIs: Responsive Images
Common WordPress APIs: Responsive Images
Jonathan Bossenger
 
Custom Tables in WordPress
Custom Tables in WordPressCustom Tables in WordPress
Custom Tables in WordPress
Jonathan Bossenger
 
The WordPress Database
The WordPress DatabaseThe WordPress Database
The WordPress Database
Jonathan Bossenger
 
Managing a WordPress Multisite Network
Managing a WordPress Multisite NetworkManaging a WordPress Multisite Network
Managing a WordPress Multisite Network
Jonathan Bossenger
 
Introduction to WordPress Multisite Networks
Introduction to WordPress Multisite NetworksIntroduction to WordPress Multisite Networks
Introduction to WordPress Multisite Networks
Jonathan Bossenger
 
Custom Post Types and Capabilities.pptx
Custom Post Types and Capabilities.pptxCustom Post Types and Capabilities.pptx
Custom Post Types and Capabilities.pptx
Jonathan Bossenger
 
Developing WordPress User Roles and Capabilities
Developing WordPress User Roles and CapabilitiesDeveloping WordPress User Roles and Capabilities
Developing WordPress User Roles and Capabilities
Jonathan Bossenger
 
Extending WordPress: common security vulnerabilities
Extending WordPress: common security vulnerabilitiesExtending WordPress: common security vulnerabilities
Extending WordPress: common security vulnerabilities
Jonathan Bossenger
 
WP REST API - custom routes and endpoints
WP REST API - custom routes and endpointsWP REST API - custom routes and endpoints
WP REST API - custom routes and endpoints
Jonathan Bossenger
 
WP REST API - modifying responses
WP REST API - modifying responsesWP REST API - modifying responses
WP REST API - modifying responses
Jonathan Bossenger
 

More from Jonathan Bossenger (20)

New WordPress Developer APIs The Interactivity API
New WordPress Developer APIs The Interactivity APINew WordPress Developer APIs The Interactivity API
New WordPress Developer APIs The Interactivity API
 
The WordPress HTML API
The WordPress HTML APIThe WordPress HTML API
The WordPress HTML API
 
The WordPress Create Block tool
The WordPress Create Block toolThe WordPress Create Block tool
The WordPress Create Block tool
 
PHP compatibility testing with PHPCompatibilityWP
PHP compatibility testing with PHPCompatibilityWPPHP compatibility testing with PHPCompatibilityWP
PHP compatibility testing with PHPCompatibilityWP
 
Common WordPress APIs_ Settings API
Common WordPress APIs_ Settings APICommon WordPress APIs_ Settings API
Common WordPress APIs_ Settings API
 
Common WordPress APIs - Options API
Common WordPress APIs - Options APICommon WordPress APIs - Options API
Common WordPress APIs - Options API
 
What’s new for developers_ (August 2023).pptx
What’s new for developers_ (August 2023).pptxWhat’s new for developers_ (August 2023).pptx
What’s new for developers_ (August 2023).pptx
 
Testing your plugins for PHP version compatibility
Testing your plugins for PHP version compatibilityTesting your plugins for PHP version compatibility
Testing your plugins for PHP version compatibility
 
Common WordPress APIs_ Global Variables
Common WordPress APIs_ Global VariablesCommon WordPress APIs_ Global Variables
Common WordPress APIs_ Global Variables
 
Testing WordPress 6.3 - Developer edition
Testing WordPress 6.3 - Developer editionTesting WordPress 6.3 - Developer edition
Testing WordPress 6.3 - Developer edition
 
Common WordPress APIs: Responsive Images
Common WordPress APIs: Responsive ImagesCommon WordPress APIs: Responsive Images
Common WordPress APIs: Responsive Images
 
Custom Tables in WordPress
Custom Tables in WordPressCustom Tables in WordPress
Custom Tables in WordPress
 
The WordPress Database
The WordPress DatabaseThe WordPress Database
The WordPress Database
 
Managing a WordPress Multisite Network
Managing a WordPress Multisite NetworkManaging a WordPress Multisite Network
Managing a WordPress Multisite Network
 
Introduction to WordPress Multisite Networks
Introduction to WordPress Multisite NetworksIntroduction to WordPress Multisite Networks
Introduction to WordPress Multisite Networks
 
Custom Post Types and Capabilities.pptx
Custom Post Types and Capabilities.pptxCustom Post Types and Capabilities.pptx
Custom Post Types and Capabilities.pptx
 
Developing WordPress User Roles and Capabilities
Developing WordPress User Roles and CapabilitiesDeveloping WordPress User Roles and Capabilities
Developing WordPress User Roles and Capabilities
 
Extending WordPress: common security vulnerabilities
Extending WordPress: common security vulnerabilitiesExtending WordPress: common security vulnerabilities
Extending WordPress: common security vulnerabilities
 
WP REST API - custom routes and endpoints
WP REST API - custom routes and endpointsWP REST API - custom routes and endpoints
WP REST API - custom routes and endpoints
 
WP REST API - modifying responses
WP REST API - modifying responsesWP REST API - modifying responses
WP REST API - modifying responses
 

Recently uploaded

Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
Alex Pruden
 
Public CyberSecurity Awareness Presentation 2024.pptx
Public CyberSecurity Awareness Presentation 2024.pptxPublic CyberSecurity Awareness Presentation 2024.pptx
Public CyberSecurity Awareness Presentation 2024.pptx
marufrahmanstratejm
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
Intelisync
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
saastr
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Precisely
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
ScyllaDB
 
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
Hiike
 
SAP S/4 HANA sourcing and procurement to Public cloud
SAP S/4 HANA sourcing and procurement to Public cloudSAP S/4 HANA sourcing and procurement to Public cloud
SAP S/4 HANA sourcing and procurement to Public cloud
maazsz111
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
Antonios Katsarakis
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
HarisZaheer8
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 

Recently uploaded (20)

Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
 
Public CyberSecurity Awareness Presentation 2024.pptx
Public CyberSecurity Awareness Presentation 2024.pptxPublic CyberSecurity Awareness Presentation 2024.pptx
Public CyberSecurity Awareness Presentation 2024.pptx
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
 
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
 
SAP S/4 HANA sourcing and procurement to Public cloud
SAP S/4 HANA sourcing and procurement to Public cloudSAP S/4 HANA sourcing and procurement to Public cloud
SAP S/4 HANA sourcing and procurement to Public cloud
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 

Let's code_ WP REST API - custom routes and endpoints.pptx

  • 1. Jonathan Bossenger Let’s Code Learn.WordPress.org Extending the WP REST API - custom routes & endpoints
  • 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 • Postman https://www.postman.com/downloads/ Then, let everyone know in the chat where you’re joining us from, and something interesting about your city/state/country… 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 - custom routes and endpoints Jonathan Bossenger
  • 4. Announcements ○ Welcome, and thank you to Joshua 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 my shared screen. ○ 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://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/1304
  • 6. Learning Outcomes 1. Registering a custom WP REST API route 2. Registering different route endpoints 3. How to access WP REST API request data in your custom route 4. Protecting routes/requiring authentication 5. Adding and using path variables on routes
  • 7. Objectives 1. Create a form submissions REST API plugin 2. Create a custom table to store form submissions 3. Register a custom WP REST API route to fetch submissions 4. Register a custom WP REST API route to post submissions 5. Register a custom WP REST API endpoint to fetch a single submission 7
  • 9. Resources ○ https://github.com/WordPress/Learn/issues/1304 ○ https://www.postman.com/downloads/ ○ https://developer.wordpress.org/rest-api/extending-the-rest-api/adding-custom-endpoints/ ○ https://developer.wordpress.org/rest-api/extending-the-rest-api/routes-and-endpoints/ ○ https://developer.wordpress.org/reference/functions/dbdelta/ ○ https://developer.wordpress.org/reference/functions/register_rest_route/ ○ https://developer.wordpress.org/reference/functions/register_activation_hook/ ○ https://developer.wordpress.org/reference/functions/current_user_can/ ○ https://github.com/CastosHQ/Seriously-Simple-Podcasting/tree/master/php/classes/rest

Editor's Notes

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