Wrap-up

Course Recap: AI in the Editor vs. AI on the Backend

⏱ 11 min

Seven lessons ago, this course opened by drawing a line between AI running on the backend, Courses 1 through 8’s territory, and AI running live inside the block editor. Everything since has been the second half of that line: a real block, a Block Bindings source, a sidebar panel, a toolbar action, and an inserter variation. This closing lesson ties both halves together, so the decision of which pattern to reach for isn’t guesswork the next time a feature request comes in.

What you'll learn in this lesson
The two patterns, side by side
Where the AI call originates and how each one authenticates, recapped in one place.
A decision guide for new features
Concrete signals for choosing editor-side versus backend-side for a given request.
What this course built, block by block
A quick map of all five lessons' output and how they connect.
Where to go next in the track
Which of the other 17 courses builds on which part of what you just did.
Prerequisites

This lesson assumes you’ve completed, or at least skimmed, Lessons 1 through 7 of this course. It doesn’t introduce new code, it connects what’s already been built.

Step 1: The two patterns, side by side

Editor-side (this course) versus backend-side (Courses 1 to 8)
Editor-sideBackend-side
Where the call originatesJS running in wp-admin, live, while a post is openPHP running on the server, triggered by a hook, cron, or an ability
Who or what is authenticatedThe logged-in editor, via cookie and REST nonceAn external MCP client, via Application Password
What triggers the AI callA click: a button, a toolbar action, a panel actionAn event: a save, a scheduled task, a tool invocation
Typical audienceThe person writing the content, right nowAn automated process or a remote assistant, no human watching
This course’s examplesAI Text block, alt-text binding, tags panel, toolbar rewrite, summary variationcreate-draft-post ability, scheduled SEO rewrite, MCP-exposed tools

Both patterns end at the same place, a call into wp_ai_client_prompt(). What differs is everything upstream of that call: who’s asking, how they proved who they are, and what moment in the content lifecycle triggered the request.

Step 2: A decision guide for the next feature request

Reach for the editor-side pattern from this course when the feature is something an author does deliberately, while looking at the content, and expects to see the result immediately: rewrite this paragraph, suggest tags for this post, summarize this block. The author is present, the request is synchronous, and the UI needs to live where they’re already working.

Reach for the backend-side pattern from Courses 1 through 8 when the feature runs without anyone watching, on a schedule, in response to a webhook, or as a tool an external AI agent decides to call on its own: nightly SEO audits, an agent creating draft posts on your behalf, a chatbot answering questions about your site’s content from outside WordPress entirely. Nobody is sitting in the editor waiting for that result, so there’s no editor UI to build in the first place.

A single feature can use both, at different moments

Lesson 4’s AI-generated alt text is a good example of straddling the line: the value is generated once (arguably backend-shaped, cached and computed independently of any one editing session) but exposed and eventually regenerated through editor-side UI. Don’t treat the two patterns as mutually exclusive within one feature, treat them as two tools that solve different halves of the same problem.

Step 3: What you built, lesson by lesson

This course's output, mapped to what it demonstrated
Lessons 1 to 2: the foundation
Cookie/nonce auth via apiFetch, and a complete AI Text block calling a REST endpoint that runs wp_ai_client_prompt().
Lessons 3 to 4: Block Bindings
register_block_bindings_source(), and an AI-generated, cached value bound to an image's alt attribute.
Lesson 5: the sidebar
PluginDocumentSettingPanel suggesting and applying real post tags.
Lesson 6: the toolbar
editor.BlockEdit and BlockControls adding an AI action to blocks you don't own.
Lesson 7: the inserter
A block variation giving one block type a second, pre-configured identity in the inserter.

Every one of these pieces reused the same two building blocks: a REST endpoint whose callback calls wp_ai_client_prompt(), and @wordpress/api-fetch calling that endpoint from inside an authenticated editor session. Nothing here required a different entry point per lesson, the variety came from where in the editor’s UI that same underlying call got wired in.

Test it: confirm your own build still holds together end to end

Open a post that has the AI Text block, an AI-bound image, some tagged content, and a paragraph, in other words, everything from this course, on one screen. Confirm: the AI Text block’s button still rewrites its own content, the bound image still shows its cached AI alt text without a new API call on reload, the AI Suggested Tags panel still applies a real tag, the toolbar action still rewrites a plain paragraph, and the AI Summary Block variation still appears in the inserter. If all five hold up together, the REST endpoints and the editor-side wiring are genuinely solid, not just working in isolation.

Don't let five features share one REST route without separate rate-limiting thought

Because this course deliberately reused /my-plugin/v1/rewrite across the block, the toolbar action, and (with a different instruction) the summary variation, a single busy editor session can trigger several AI calls in quick succession across unrelated-looking UI. If cost or provider rate limits become a real concern, that’s a reason to add throttling or a shared in-flight-request guard at the REST layer, not a reason to duplicate the endpoint per feature.

Recap

The pattern this course taught, an AI call triggered by a click inside the block editor, authenticated by the logged-in user’s own cookie and nonce through @wordpress/api-fetch, is the right tool whenever a human is present and expects an immediate result. The pattern Courses 1 through 8 taught, an ability or a scheduled PHP call authenticated by an Application Password or run entirely server-side, is the right tool whenever nothing is watching and the trigger is an event, not a click. Real WordPress sites doing serious AI work typically need both, and now you’ve built a working example of each.

Resources & further reading

← Adding AI Blocks to the Inserter via Block Variations Finish ✓