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

Start free trial

LearnDash Manage Lesson

learndash/manage-lesson creates a new lesson or updates an existing one.

A newly created lesson is not attached to any course. learndash/attach-step does that.

At a glance

Abilitylearndash/manage-lesson
ToolsetLearnDash — toolset/learndash
GroupLearnDash › Lessons, Topics & Quizzes
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

How it works

The separation is deliberate rather than an omission. A lesson can belong to several courses, and the attachment carries its own information — which course, under which parent, in which position — that a creation call has no natural place for.

It also means a lesson created and never attached is a normal intermediate state rather than a failure.

Settings are written through LearnDash’s own accessor, so the meta LearnDash mirrors internally stays consistent. Writing the meta directly leaves the two copies disagreeing, and LearnDash reads whichever one it happens to read.

The settings worth knowing: sample_lesson marks a free preview, visible_after and visible_after_specific_date control drip-feed, lesson_assignment_upload requires a file, lesson_assignment_points_enabled and lesson_assignment_points_amount score it, forced_lesson_time sets a minimum time on the page, and lesson_video_enabled with lesson_video_url adds video progression.

Several of those block completion. Setting them on a lesson learners are already partway through changes what they have to do, retroactively.

Idempotent.

Input

NameTypeRequiredWhat it is
actionstringYescreate or update.
lesson_idintegerFor updateWhich lesson.
titlestringFor createThe lesson title.
contentstringNoThe lesson content.
statusstringNoPost status.
settingsobjectNoLearnDash settings keys.

What comes back

NameTypeWhat it is
lessonobjectThe lesson after the write.
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:

Create a lesson and add it to the course.

It resolves to one call:

{
  "ability": "learndash/manage-lesson",
  "parameters": {
    "action": "create",
    "title": "Setting up your workspace"
  }
}

Worth knowing

  • Not attached on creation. Attaching is a separate call and can target several courses.
  • Completion-blocking settings apply retroactively to learners already in progress.
  • Written through LearnDash’s accessor.
  • Idempotent.

Related abilities


Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading