-
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
Post Tags: Fix bug where no tags are rendered #24082
Conversation
I think this is accurate -- with a caveat, plugins can override that behavior. But I think it's fine for a first iteration to only look at the post type; maybe a
I would find that preferable TBH -- UX-wise, I think it makes sense to hide something from the user that doesn't make sense in the given context, rather than informing them after the fact. I'm doing something similar here for the Post Content Block when used outside of templates and template parts: #24006 |
Oh, looks like we can: http://localhost:8888/index.php?rest_route=%2Fwp%2Fv2%2Ftaxonomies%2Fpost_tag%2F&context=edit&_locale=user has a However, I'm not sure we can do that easily during Gutenberg's client-side block registration (i.e. in |
(Alternatively, we might do this server-side, once WordPress/wordpress-develop#419 gets merged.) |
@ockham Your reasoning makes sense. Thanks for the insight into how to make this possible. 🙏 I'm happy to switch gears, but how do you feel about checking in with Jon before finalizing the decision? cc @dubielzyk for opinions on how to handle the post tags block |
Exploring an alternative that doesn't need WordPress/wordpress-develop#419 in #24114. If that flies, we can carry the principle over here. |
Didn't fly 😬 Ignore for now 😅 |
I agree with @ockham that we ideally shouldn't allow them to add it to the post. Is it possible to hide it from the block inserter? If we show it, the warning is good, but I'd wanna refine the copy and perhaps add a little warning symbol there. It seems too "not wrong" at the moment. |
Sad that it didn't work out, but A+ for effort 👏
@ockham It sounds like the way forward might be to prevent
@dubielzyk The warning symbol makes sense to me. Would it be okay to add this as an issue to the create design board and circle back? It seems like an easy change, but it would update all instances of warnings in the site editor and post editor. I think raising this with a broader audience would be nice to ensure we're not missing an important consideration. |
So you'd be using the standard "block render error" that's used for all other blocks as well? If so, then yeah, let's just use that :) But ideally we would wanna prevent them to add it at all if possible. |
Work is also being done on the post categories block by @Copons. There are discussions about similar UX decisions (hiding blocks vs. showing warnings) Here is what we know:
How would we feel about creating a separate issue to tackle hiding blocks? We could unblock the current PRs and I could follow up on the new issue immediately. I'd ensure that hiding both |
Sounds good 👍 |
Post tags were previously misaligned when rendered in the front-end. The wrapping div now constrains the tags within the predefined margins of site editor content.
Update phrasing for warning Co-authored-by: Bernie Reiter <ockham@raz.or.at>
This is working great for me! |
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.
This is working great for me!
I've left a few very minor suggestions, but this is basically ready!
@Copons Thanks for reviewing this! I think we're in the home stretch 🎉
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.
This worked well for me. Nice work @jeyip!
Description
This PR addresses a task in #21087 and is meant to add feature parity to FSE blocks. Previously, when the post tags block was added to a view, post tags were not being loaded. This PR implements a solution similar to what @Addison-Stavlo did for the post excerpt block in #23945.
Important Notes
How has this been tested?
Tested on local docker wp-env environment.
Screenshots
Query Loop Index
Singular
Static Home Page (Rendering post tags on pages doesn't seem to make sense. Instead I render a warning)
Types of changes
Bug fix (non-breaking change which fixes an issue)
Checklist: