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
| Ability | learndash/get-course-structure |
| Toolset | LearnDash — toolset/learndash |
| Group | LearnDash › Course Structure |
| Requires | AcrossAI Pro, plus LearnDash LMS active on the site |
| Capability | manage_options |
| Safety | Read-only — changes nothing |
| Repeatable | Idempotent — running it twice leaves the same result |
| Ships in | AcrossAI 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
| Name | Type | Required | What it is |
|---|---|---|---|
course_id | integer | Yes | The course. |
What comes back
| Name | Type | What it is |
|---|---|---|
structure | array | The nested tree of lessons, topics and quizzes. |
sections | array | Section headings. |
step_count | integer | Total steps, excluding section headings. |
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:
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
- LearnDash Attach Step — add to the tree
- LearnDash Reorder Steps — which needs the current order
- LearnDash Detach Step — remove from the tree
Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager
Browse the rest: Every ability, by category