learndash/attach-step attaches an existing lesson, topic or quiz to a course under a chosen parent.
The step must already exist — this places content, it does not create it.
At a glance
| Ability | learndash/attach-step |
| Toolset | LearnDash — toolset/learndash |
| Group | LearnDash › Course Structure |
| Requires | AcrossAI Pro, plus LearnDash LMS active on the site |
| Capability | manage_options |
| Safety | Writes data |
| Repeatable | Idempotent — running it twice leaves the same result |
| Ships in | AcrossAI Pro 0.9.16 and later |
The valid pairings
A course accepts lessons and quizzes. A lesson accepts topics and quizzes. A topic accepts quizzes only.
Omit parent_id to attach directly to the course. Anything else is a parent within it.
Those pairings are LearnDash’s hierarchy rather than a restriction imposed here, and a pairing outside them is refused — a topic cannot hang off a course however much a course outline might want it to.
set_primary, true by default, makes this course the step’s primary course. That matters when a step is shared across several courses: the primary course is the one LearnDash uses for breadcrumbs, for certificates and for resolving which course a learner is “in” when they open the step.
Sharing steps across courses is a genuine LearnDash feature and a frequent source of confusion, because editing a shared lesson edits it everywhere.
Idempotent.
Input
| Name | Type | Required | What it is |
|---|---|---|---|
course_id | integer | Yes | The course to attach into. |
step_id | integer | Yes | The lesson, topic or quiz. |
parent_id | integer | No | The parent within the course. Omit to attach at course level. |
set_primary | boolean | No — defaults to true | Make this course the step’s primary course. |
What comes back
| Name | Type | What it is |
|---|---|---|
step_id | integer | The step attached. |
course_id | integer | The course. |
success | boolean | Whether the call completed. |
message | string | A one-line summary of what happened, suitable for showing a human. |
error_code | string | Present only on failure — a stable machine-readable reason, such as a missing field, a wrong field type or an unmet confirmation. |
Example
Ask your assistant:
Add that lesson to the onboarding course.
It resolves to one call:
{
"ability": "learndash/attach-step",
"parameters": {
"course_id": 412,
"step_id": 520
}
}Worth knowing
- Course takes lessons and quizzes; lesson takes topics and quizzes; topic takes quizzes.
- A step can belong to several courses, and editing it edits it everywhere.
- The primary course decides breadcrumbs and certificate resolution.
- Idempotent.
Related abilities
- LearnDash Get Course Structure — see the current tree
- LearnDash Detach Step — the reverse
- LearnDash Reorder Steps — position it
Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager
Browse the rest: Every ability, by category