-
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
Pattern Category: change show_tagcloud to false #57212
Conversation
Size Change: +31 B (0%) Total Size: 1.71 MB
ℹ️ View Unchanged
|
89b7be3
to
95e8b6b
Compare
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 think the wp_pattern_category
needs set show_tagcloud
to false
. The block already filters results based on this value.
.filter( ( tax ) => !! tax.show_cloud ) |
return _taxonomies?.filter( | ||
( { visibility } ) => visibility?.publicly_queryable | ||
); |
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.
We should avoid using filter
, map
, and similar actions inside the selector. Plus, getTaxonomyOptions
already filters and maps values.
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.
Yeah, show_tagcloud
would do it.
Thanks for the review, @Mamaduka!
Oh, I missed that 😅
Indeed. The pattern category is probably also unintentionally displayed in the tag cloud widget. I'll do some more research and then update this PR. |
This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress. If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged. If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack. Thank you! ❤️ View changed files❔ lib/compat/wordpress-6.5/block-patterns.php |
I updated it to simply add I would like to submit a core ticket and core PR if this change makes sense. |
We will need to eventually for 6.5 - which also means we should move the file under that compat folder. |
f29d9ff
to
80424f0
Compare
Done 👍 |
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.
Thank you!
Core Ticket: https://core.trac.wordpress.org/ticket/60119 |
Thank you for working on this. Once the code is merged into WP Core please could you
Thank you in advance 🙇 |
Fixes #57211
What?
This PR prevents the selection of taxonomies with publicly_queryable set to false in the Tag Cloud block. As a result, the "Pattern Categories" taxonomy cannot be selected.This PR sets
show_tagcloud
tofalse
when registering a pattern category taxonomy (wp_pattern_category
).Why?
I think the Pattern Categories is only used by site administrators to categorize patterns, and should not be displayed on the front end.
How?
Check if thepublicly_queryable
property istrue
. This is also used in the following places:When generating variations based on the registered taxonomy in the Post terms block (See)When creating a new template in the Site Editor (See)Added
'show_tagcloud' =>false
toregister_taxonomy()
parameter.Testing Instructions
Tag Cloud Block
Tag Cloud Widget