Repository navigation
Add core/post-types-query ability - #1106
Draft
jorgefilipecosta wants to merge 13 commits into
Draft
jorgefilipecosta wants to merge 13 commits into
jorgefilipecosta wants to merge 13 commits into
Conversation
✅ WordPress Plugin Check Report
📊 ReportAll checks passed! No errors or warnings found. 🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1106 +/- ##
=============================================
+ Coverage 81.53% 81.89% +0.35%
- Complexity 3071 3127 +56
=============================================
Files 129 131 +2
Lines 12253 12525 +272
=============================================
+ Hits 9991 10257 +266
- Misses 2262 2268 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Member
|
@jorgefilipecosta note that I'm holding off on requesting reviews until this comes out of draft status |
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.
What?
Adds
core/post-types-query, a read-only ability that reads the post types exposed to abilities.How?
includes/Abilities/Post_Types/Post_Types.php, behind the Custom Abilities experiment.slug, or the exposed post types, returned as{ post_types }.show_in_abilitiescan be read (postandpageby default). Any other slug is treated as missing. Any logged-in user can read them.name,slug,description,hierarchical,has_archive,taxonomies,icon,template, andtemplate_lockare returned by default.capabilities,labels,supports,viewable, andvisibilityneed permission to edit posts of the type, so asking for one lists only the post types the user can edit.Testing Instructions
core/post-types-querywith{},{ "slug": "page" }, and{ "slug": "post", "fields": [ "name", "supports" ] }.npm run test:php -- --filter 'Post_Types|Gated_Abilities'npm run test:e2e -- tests/e2e/specs/abilities/core-post-types-query.spec.jsChangelog Entry