[memb_sensei_course_reset]
Description
Renders a self-service "reset my progress" form. The form carries
HMAC-signed parameters (user, admin, tag, completion message) and a
nonce scoped to the user (wpal/torii/sensei/delete_history/{user});
the submission handler validates both before wiping course progress
and optionally applying a tag.
Guard rails:
- Administrators can't use it, they see an explanatory error.
admin_idis required and must reference a real administrator.- Only renders on singular pages for logged-in non-admin users.
The JavaScript confirm dialog shows the warning text before
submitting.
Shortcode Examples
[memb_sensei_course_reset admin_id="31"]
Custom text:
[memb_sensei_course_reset admin_id="31" tag_id="123" button_text="Start Over" warning="Erase all progress?" completion="Progress cleared!"]
Shortcode Parameters
admin_id
User ID of the administrator attributing the reset. Required.
Default: 0.
tag_id
Tag ID applied after the reset completes. Default: 0.
button_text
Submit button text. Default: 'Clear Course History'.
warning
Confirm dialog text. Default: 'Are you sure you want to clear your course history? This cannot be undone.'.
completion
Success message shown after reset. Default: 'Your course history has been cleared.'.
Shortcode Attributes
| Attribute | Value |
|---|---|
| Conditional | No |
| Nestable | No |
| Accepts formatting | No |
Hooks
The reset submission fires wpal/torii/sensei/delete_history-scoped
nonce verification; no public actions or filters fire.