-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Terms Query: add Max Terms control #71358
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
Terms Query: add Max Terms control #71358
Conversation
…r' into add/terms-query-max-terms
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
| 'per_page' => $query['perPage'] ?? 100, | ||
| 'page' => $query['pages'] ?? 1, | ||
| 'taxonomy' => $query['taxonomy'] ?? 'category', | ||
| 'number' => $query['perPage'] ?? 10, |
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.
As per https://developer.wordpress.org/reference/classes/wp_term_query/ there's no page argument and we should use number instead of per_page.
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.
Nice, good spot!
mikachan
left a comment
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.
Thanks for working on this, it's testing really well for me 🙌
I've just left one small wording suggestion, but othewise I think this is good to bring in when the conflicts are resolved.
| 'per_page' => $query['perPage'] ?? 100, | ||
| 'page' => $query['pages'] ?? 1, | ||
| 'taxonomy' => $query['taxonomy'] ?? 'category', | ||
| 'number' => $query['perPage'] ?? 10, |
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.
Nice, good spot!
|
Thanks @mikachan , I addressed your comment and resolved conflicts! 🙌 |
mikachan
left a comment
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!
|
I'm not sure why this Storybook test isn't running. I've tried re-running it a couple of times. Maybe we should try merging the main branch in again? |
Updating the branch didn't help 😅 I see it passes on other contributions and I've no idea why it's failing here. Also, I can't re-run myself 😓 |
|
No problem, I'll try to figure it out. Maybe the main branch needs rebasing with trunk, but then the Storybook check has passed there. It's not even a failed check, it looks like the environment is struggling to install the Storybook deps. We could even merge the PR regardless, as it's not going directly to trunk anyway. Maybe I'll end up doing that 😅 |
de054eb to
9cbbd4e
Compare
9cbbd4e to
de054eb
Compare
|
I think the base branch needed updating with trunk 🤔 Anyway, looks like we're good to go now! |
28048ca
into
WordPress:add/terms-query-block-container
What?
Part of #49094.
This PR adds "Max terms" setting in Terms Query block. It limits the number of terms being displayed. The setting is only available if "Show hierarchical" data is disabled since there's not "right" way of limiting terms then.
Note
Mind this PR is targeting #70720 not
trunkWhy?
This is to allow creating more appealing layouts (e.g. showing hundreds of categories may be overwhelming and simply ugly) and highlighting some categories.
How?
Testing Instructions
0Testing Instructions for Keyboard
Screenshots or screencast