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

Start free trial

LearnDash Get Course Structure

learndash/get-course-structure returns the full outline of a course as a nested tree: its lessons in order, the topics under each lesson, and quizzes wherever they sit.

It also returns section headings and a total step count.

At a glance

Abilitylearndash/get-course-structure
ToolsetLearnDash — toolset/learndash
GroupLearnDash › Course Structure
RequiresAcrossAI Pro, plus LearnDash LMS active on the site
Capabilitymanage_options
SafetyRead-only — changes nothing
RepeatableIdempotent — running it twice leaves the same result
Ships inAcrossAI Pro 0.9.16 and later

How it works

Quizzes are the reason a flat listing does not suffice. A quiz can sit at course level, lesson level or topic level, and where it sits determines when a learner meets it — after everything, after one lesson, or after one topic.

Nothing in a quiz’s own record says which. Only the tree does.

Section headings are structural labels rather than steps, so they appear in the tree and do not count toward the step total.

This is the required first call for learndash/attach-step, learndash/detach-step and learndash/reorder-steps, all of which operate on IDs from this tree — and the last of which rejects a partial list, so the current order has to be known.

The step count is also what makes a deletion’s scale visible before it happens.

Input

NameTypeRequiredWhat it is
course_idintegerYesThe course.

What comes back

NameTypeWhat it is
structurearrayThe nested tree of lessons, topics and quizzes.
sectionsarraySection headings.
step_countintegerTotal steps, excluding section headings.
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:

What is in this course, in order?

It resolves to one call:

{
  "ability": "learndash/get-course-structure",
  "parameters": {
    "course_id": 412
  }
}

Worth knowing

  • Only the tree shows which level a quiz is attached at.
  • Section headings are labels, not steps.
  • Required before attaching, detaching or reordering.
  • Read-only.

Related abilities


Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading