-
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 list item wrapper to social links when used in navigation block #61396
Add list item wrapper to social links when used in navigation block #61396
Conversation
This solves the invalid markup, I would say this can be merged when the PHP coding standard issue is fixed. There is always a risk that the markup change makes existing third party CSS invalid, so there needs to be a dev note/ added to the "What's new in Gutenberg" etc; some outreach to extenders. |
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 Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @timofey-drozhzhin. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. 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. |
8f4e346
to
8659498
Compare
Thanks @carolinan! |
Dev Note (draft)As of WordPress 6.6, the social links block will be wrapped in a list item ( This may affect some themes that depend on the exact nesting of the HTML elements, for example using a selector like Here are some examples of how the HTML has changed: Example of navigation block and social links markup before WordPress 6.6 <ul class="wp-block-navigation__container wp-block-navigation">
<ul class="wp-block-social-links is-layout-flex wp-block-social-links-is-layout-flex">
</ul>
</ul> Example of navigation block and social links markup after WordPress 6.6 <ul class="wp-block-navigation__container wp-block-navigation">
<li class="wp-block-navigation-item">
<ul class="wp-block-social-links is-layout-flex wp-block-social-links-is-layout-flex">
</ul>
</li>
</ul> |
What?
Fixes #61385
Why?
As mentioned in that issue, when the social block is used in the navigation block, the front-end markup has a
<ul>
nested in a<ul>
, when it seems the proper thing to do is have a wrapping<li>
tag.How?
There's an array
$needs_list_item_wrapper
in the server render callback for the navigation block, and adding social links to that seems to do the trick.Testing Instructions
<li>
tagAlso check that none of the styling is broken (this is my greatest concern with the change).
Screenshots or screencast