Branding
nonprofit_lms_branding_tokensreceives the whole token map plus the saved settings.nonprofit_lms_branding_updatedfires after a save.- The REST routes live under
nonprofit-lms/v1/settings/brandingand need themanage_lmscapability.
Profile fields and certificates
nonprofit_lms_profile_field_partsfilters the part labels of an address or name field (relabel “State / Province” as “County”, say). Keys and order are fixed.- Certificate templates can use
{profile:your-field}for the one line value and{profile:your-field:city}(orstreet,street2,state,postal,first,last) for a part. - The Students and export REST filters (
field_your-field=…) accept every active field, whether or not it’s offered as a filter on screen.
Date fields
nonprofit_lms_date_field_yearsreceives and returns an array withstartandendyears. The default is this year back one hundred.nonprofit_lms_date_field_parts_orderreceives and returns the order of'month','day'and'year', for day, month, year order outside the US, for example. The stored value is always a single YYYY-MM-DD date, so reports and exports don’t change.
Consent notice
nonprofit_lms_consent_notice_renderedfilters the notice after the{privacy_policy}and{terms}placeholders have become links.
Page builder layouts in lessons
Lesson content is expanded with do_shortcode() when the student player fetches it, so any shortcode works inside a lesson. Because that happens in a REST request, the player page scans the course’s lessons up front and loads each referenced layout’s assets itself.
nonprofit_lms_lesson_layout_shortcodesmaps a layout shortcode tag to its asset callback. Beaver Builder ships as the one entry; add another builder here rather than touching the player.- After content lands in the page, the player dispatches
nonprofit-lms:content-injectedondocument, with{ container, lessonId }. That’s where a builder’s own re-init runs. - A shortcode expanded in a lesson runs without a current post, so anything that depends on
get_the_ID()behaves differently there than on a page.
Interactive elements
- The placement tag is
[lms_element key="…"](or[lms_element id="…"]for a row by its database id). It’s plain text in the stored lesson content and is resolved once, on the server, into thecontent_segmentsof the student lesson payload. nonprofit_lms_element_placementreceives the resolved{ segments, placed_keys }.nonprofit_lms_slideshow_slidesreceives the slides of an Interactive Slideshow (image URL, srcset, alt, dimensions).
Quizzes
nonprofit_lms_grade_quiz_responsecan override grading.- A question students have answered is archived rather than deleted when a save drops it (
archived_atonlms_quiz_questionsandlms_survey_questions). Four actions fire around that write, each with the question id and its quiz or survey id:nonprofit_lms_before_quiz_question_archived,nonprofit_lms_after_quiz_question_archived,nonprofit_lms_before_survey_question_archivedandnonprofit_lms_after_survey_question_archived. - Each question in
nonprofit-lms/v1/reports/courses/{course_id}/quiz-analysiscarries a booleanno_correct_answer. nonprofit_lms_quiz_attempt_expiredfires once with the old attempt’s id, the user id and the quiz id when a new attempt replaces an expired one.DELETE /wp-json/nonprofit-lms/v1/quizzes/{quiz_id}/attempts/{user_id}resets attempts without deleting anything, andnonprofit_lms_after_quiz_attempts_resetreceives the ids it reset.
Assignments
nonprofit_lms_assignment_allowed_file_types(pdf, doc, docx, txt, rtf, odt, jpg, jpeg, png, gif and zip by default) andnonprofit_lms_assignment_max_file_bytes(25 MB by default) set what students can upload.nonprofit_lms_submissions_dirchanges where submission files are stored.nonprofit_lms_allow_assignment_resubmission(default false, with the user id and assignment id) allows another submission.- A daily WP-Cron event,
nonprofit_lms_sweep_unsubmitted_files, deletes up to 100 unsubmitted files older than a day, andnonprofit_lms_unsubmitted_file_sweptfires for each.
REST routes and ids
Routes that check an instructor’s course take the course from the item named in the route’s own address, never from a course_id or topic_id in the query string or body. A request that names a different course is refused with a 403. Every id in a route must be a plain positive whole number.