-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 CPT selector to Latest Posts #20831
Conversation
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.
Looks great. The only major change is that json file that got entirely commited and maybe we should rename that category related variable in the other PR.
Testing locally I noticed all post types are shown, including system types, which should be hidden:
Normally from that list only Posts and Pages are thing one would want to filter on.
"default":null | ||
} | ||
} | ||
"name": "core/latest-posts", |
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.
It looks like this file has been reformatted and for no good reason. We should revert this change to only include
"postType": {
"type": "string"
},
It's probably an editor spaces setting issue :)
} = attributes; | ||
const suggestions = categoriesList.reduce( | ||
const categorySuggestions = categoriesList.reduce( |
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.
you changed this here from my comment in the other PR right?
@@ -254,10 +274,11 @@ class LatestPostsEdit extends Component { | |||
value: item.name || item.value, | |||
} ) ) | |||
} | |||
suggestions={ Object.keys( suggestions ) } | |||
suggestions={ Object.keys( categorySuggestions ) } |
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.
same, this is from the other PR. if we change in both places we might end up with conflicts 😁
Trac is also showing a linter issue here:
If you setup ESLint in VSCode these will be caught by the editor. Also Gutenberg has some git pre-commit hooks that catch these before the commit, I wonder why they don't run for you. |
Hey @Ringish. Thanks for all the work you've done so far in this PR! Do you think you'll find some time to wrap it up in the next two weeks? If not, then I will probably try to work on it so that the enhancement of query related functionality isn’t delayed. |
How is this PR coming along? Order of controls should probably go like this. Screenshot from https://wordpress.org/plugins/flex-posts/ |
Hey @paaljoachim - I think the focus has shifted towards making this block a |
I would close this PR as it will be irrelevant even if it's finalized. |
Closing this PR based on above comments by Andrei @draganescu and Nik @ntsekouras |
Description
Adds a post type selector to the
LatestPosts
(in theQueryControls
) block as described at #9013 and mentioned in #20046.How has this been tested?
I've tested a few different scenarios where you would choose specific post types in the
LatestPosts
block.Screenshots
Types of changes
New feature
Checklist: