[memb_learndash_course_unenroll]

Description

Action shortcode: calls ld_update_course_access() with remove=true to revoke course access. Only operates on singular pages, for logged-in users, when LearnDash is loaded and the target is a real sfwd-courses post. Any other condition is a silent no-op.

Returns no output.

Shortcode Examples

[memb_learndash_course_unenroll course_id="123"]

Unenroll a specific user:

[memb_learndash_course_unenroll course_id="123" user_id="42"]

Shortcode Parameters

course_id

Course post ID. Required. Default: 0.

user_id

User to unenroll. Default: 0 (current user).

Shortcode Attributes

Attribute Value
Conditional No
Nestable No
Accepts formatting No