30 days free. No credit card. Full access from the moment you connect your site.

Start free trial

LearnDash Attach Step

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

Abilitylearndash/attach-step
ToolsetLearnDash — toolset/learndash
GroupLearnDash › Course Structure
RequiresAcrossAI Pro, plus LearnDash LMS active on the site
Capabilitymanage_options
SafetyWrites data
RepeatableIdempotent — running it twice leaves the same result
Ships inAcrossAI 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

NameTypeRequiredWhat it is
course_idintegerYesThe course to attach into.
step_idintegerYesThe lesson, topic or quiz.
parent_idintegerNoThe parent within the course. Omit to attach at course level.
set_primarybooleanNo — defaults to trueMake this course the step’s primary course.

What comes back

NameTypeWhat it is
step_idintegerThe step attached.
course_idintegerThe course.
successbooleanWhether the call completed.
messagestringA one-line summary of what happened, suitable for showing a human.
error_codestringPresent 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


Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading