The Custom Controller Pattern
Open
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 333
- Forks
- 127
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 11
Description
Details
- Content type (Online Workshop, Lesson, Course, Tutorial, or Lesson Plan): Lesson
- Content title: The Custom Controller Pattern
- Topic description: Introduce the custom Controller Pattern to implement custom REST routes and endpoints for more complex API endpoints.
- Audience (User, Developer, Designer, Contributor, etc.): Developer
- Experience Level (Beginner, Intermediate, Advanced, Any): Intermediate
Prerequisites
It is assumed that the learner has already completed the following lessons:
- Beginner WordPress developer
- Modules 1 - 8
Learning Objectives
- Explain why a developer might consider a custom controller class over using register_rest_route
- Understand the custom controller class examples in the documentation
- Discuss the benefits of using a custom controller class
Related Resources and Other Notes
- https://developer.wordpress.org/rest-api/extending-the-rest-api/adding-custom-endpoints/#the-controller-pattern
- https://developer.wordpress.org/rest-api/extending-the-rest-api/controller-classes/
Automation Code
//lesson
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the two linked WordPress REST API resources, especially the controller-pattern and controller-classes sections. Draft the lesson for intermediate developers using the stated prerequisites and learning objectives; it is done when it explains the motivation, examples, and benefits of custom controller classes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- api, documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100