-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Custom Post Types support in Query block #25903
Merged
Merged
Conversation
This file contains 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
ntsekouras
added
[Feature] Full Site Editing
[Type] Feature
New feature to highlight in changelogs.
[Block] Query Loop
Affects the Query Loop Block
labels
Oct 7, 2020
Size Change: +10.9 kB (0%) Total Size: 1.19 MB
ℹ️ View Unchanged
|
mapk
approved these changes
Oct 7, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested from a UX perspective and it appears to be working well. 🎉
- Added a Post Author block. This block persisted when changing to the Post Type, Page.
- Switched back to Posts, and added Categories and Tags. Worked well.
- Switched to Pages and those were removed.
- Selected an author and that selection also persisted when switching between post types.
ntsekouras
requested review from
ajitbohra,
nerrad,
ntwb,
Soean and
talldan
as code owners
October 8, 2020 13:52
aristath
approved these changes
Oct 8, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[Block] Query Loop
Affects the Query Loop Block
[Type] Feature
New feature to highlight in changelogs.
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.
Description
Part of: #24934, which is part of #24762.
This PR add Custom Post Types support in
Query
Block. This is the first step for full support of CPTs and handles some use cases but more work is needed to be fully flexible.Some notes for this PR:
post types
we check the supportedtaxonomies
for each post type. Since we have support forcategories
andpost tags
as a separate filter, we hide/show them taking into account the supported ones. When he have filters for example intags
and change post type topages
, we clear the previous filter.This needs more investigation for how custom taxonomies are registered and associated with each post type. Testing with WooCommerce for extra post types and taxonomies and taxonomies doesn't give the expected results. In addition there will be changes in the future to support
taxonomies
in general and not specifically categories and tags, as are now (In follow up PR).I have placed the post type filter in
inspector controls
to be close to the hide/show of other coupled filters (categories etc..). This might probably change with the custom taxonomies support and other rest API limitations that exist now.I have introduced an extra check to exclude the current entity from the results. This needs more testing to also avoid infinite recursive loops.
I have removed
Pagination
block from default, because most use cases ofQuery
would be to show list of entities in various pages, especially inhome page
.Checklist: