Repository navigation
feat: add native WordPress Abilities API support - #3069
Open
wachiravit-thitagran wants to merge 3 commits into
Open
wachiravit-thitagran wants to merge 3 commits into
wachiravit-thitagran wants to merge 3 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This pull request adds native WordPress Abilities API support to Tutor LMS.
It introduces a dedicated
Tutor LMSability category and a focused set of read-only abilities for common course, curriculum, learner progress, and environment information:tutor-lms/site-infotutor-lms/list-coursestutor-lms/get-coursetutor-lms/get-course-structuretutor-lms/get-student-progressWhat this adds
wp_register_ability_category()andwp_register_ability()tutor_course_contents_post_typesfilterBackward compatibility
Tutor LMS currently supports WordPress versions that do not provide the WordPress Abilities API.
This integration is therefore optional:
Permissions and data access
The abilities do not bypass existing WordPress or Tutor LMS authorization.
Examples:
readcapability.AI and automation safety
WordPress abilities can be consumed by AI agents, automation systems, remote clients, or other WordPress integrations.
Ability metadata, descriptions, and schemas are interface information only and must not be treated as authorization. Permission and capability checks must always be enforced server-side for every execution.
The abilities introduced in this PR are intentionally read-only and marked non-destructive and idempotent. Any future write abilities should continue to:
This helps make the abilities safe for both traditional integrations and AI-driven automation.
Testing
A new
AbilitiesTestcovers: