-
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
Image block: refactor and remove data-wp-body
#58835
Conversation
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. |
Size Change: -912 B (0%) Total Size: 1.71 MB
ℹ️ View Unchanged
|
It looks like this PR refactoring reduced the size of the JS code of the lightbox by 25% 🙂 |
This pull request changed or added PHP files in previous commits, but none have been detected in the latest commit. Thank you! ❤️ |
This is ready. We saw a couple of bugs in Safari that are already present in
|
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.
Great refactoring! 👏 Glad to see that we are sending less JS and HTML to the browser 🙂
I've been testing it on Chrome, Safari, iPhone, and Android, and everything seems to be working as previously.
What?
This PR removes the use of
data-wp-body
directive in the Image block. It also refactors the logic a bit to clean up the code, and reduce the size of the JavaScript file.Why?
Because the Interactivity API won't include the
data-wp-body
directive in the WP 6.5 version.How?
By replacing the
data-wp-body
with awp_footer
filter that prints only one lightbox overlay for all the images.Testing Instructions