-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Backport Duotone fixes for 5.9.1 #2326
Conversation
/** | ||
* Render the SVG filters supplied by theme.json. | ||
* | ||
* Note that this doesn't render the per-block user-defined | ||
* filters which are handled by wp_render_duotone_support, | ||
* but it should be rendered in the same location as those to satisfy | ||
* Safari's rendering quirks. | ||
* | ||
* @since 5.9.0 | ||
*/ | ||
function wp_global_styles_render_svg_filters() { | ||
$filters = wp_get_global_styles_svg_filters(); | ||
if ( ! empty( $filters ) ) { | ||
echo $filters; | ||
} | ||
} | ||
add_action( 'wp_body_open', 'wp_global_styles_render_svg_filters' ); |
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.
For some reason the SVG filters are not rendering in the post-editor for me as if wp_body_open()
is not being called. It works fine when viewing the post. Testing with TwentyTwentyTwo with the following added to the theme.json.
{
"styles": {
"blocks": {
"core/image": {
"filter": {
"duotone": "var(--wp--preset--duotone--primary-and-secondary)"
}
}
}
}
}
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.
The wp_body_open
is template action. I don't think it's called or should be called in Dashboard.
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.
Hmm. It was being called with this setup back when I wrote that code. We'll have to find a similar action that gets called in <body>
before everything else, then
Co-authored-by: Tonya Mork <tonya.mork@automattic.com>
Co-authored-by: Tonya Mork <tonya.mork@automattic.com>
Co-authored-by: Tonya Mork <tonya.mork@automattic.com>
Co-authored-by: Tonya Mork <tonya.mork@automattic.com>
Co-authored-by: Tonya Mork <tonya.mork@automattic.com>
Co-authored-by: Tonya Mork <tonya.mork@automattic.com>
Co-authored-by: Tonya Mork <tonya.mork@automattic.com>
Co-authored-by: Tonya Mork <tonya.mork@automattic.com>
@ajlende created PR on my fork that contains a much-requested feature, allowing users to disable Duotone - Mamaduka#12. |
Committed in https://core.trac.wordpress.org/changeset/52757 |
This is a backporting patch for the following Gutenberg PRs:
Props @ajlende, @scruffian
Trac ticket: https://core.trac.wordpress.org/ticket/55179
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.