From 5cf67a85e2e3a2071749294996c39e4ed9587909 Mon Sep 17 00:00:00 2001 From: Alex Lende Date: Wed, 24 Nov 2021 09:13:29 -0600 Subject: [PATCH] Fix duotone first render in Safari (#36754) --- lib/block-supports/duotone.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/block-supports/duotone.php b/lib/block-supports/duotone.php index 4bb239c44a87d..ac0b544bfb612 100644 --- a/lib/block-supports/duotone.php +++ b/lib/block-supports/duotone.php @@ -390,10 +390,10 @@ function gutenberg_render_duotone_filter_preset( $preset ) { } add_action( - // Safari doesn't render SVG filters defined in data URIs, - // and SVG filters won't render in the head of a document, - // so the next best place to put the SVG is in the footer. - is_admin() ? 'admin_footer' : 'wp_footer', + // SVG filters won't render at all in the head of a document and + // Safari incorrectly renders SVG filters in the footer, so the + // beginning of the body seems to be the safest place to render. + 'wp_body_open', function () use ( $svg ) { echo $svg; }