-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Added filter for arguments for latest posts block #38283
base: trunk
Are you sure you want to change the base?
Added filter for arguments for latest posts block #38283
Conversation
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @martinjankov! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
@ntsekouras, what's the policy for adding classic widget filters to the Widget blocks? |
Thanks for the PR @martinjankov! I don't think we should add a widgets specific filter in a core block. Having said that, @draganescu or @talldan might have more insights about widgets and possible work arounds with another existing filter.. |
Hi @martinjankov I don't think this is a good path forward. The block has a directly editable UI for these settings. Adding a filter like that would override user settings. If you need a special case of a block the best way, today, is to create your own block implementing the special case. Am I missing something obvious? My suggestion is to close this PR. Any other thoughts @noisysocks ? |
Hmm, I'm not sure. On the one hand, we do have a few other filters in blocks that were designed to replace widgets.
On the other hand, blocks aren't widgets, and we already have filters for customising a block and its attributes before it is rendered e.g. |
This is specifically my point. |
Trac link: https://core.trac.wordpress.org/ticket/54580
Description
Added
widget_posts_args
filter for latest posts query arguments.Testing Instructions
widget_posts_args
filter and exclude the latest posts via post__not_inScreenshots
Types of changes
New feature (non-breaking change which adds functionality)
Checklist:
*.native.js
files for terms that need renaming or removal).