WordPress / WordPress/Learn

The Custom Controller Pattern

Open
#2,754 1 comment 0 reactions 0 assignees View on GitHub

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:

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

Automation Code

//lesson

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.