Skip to content

Commit

Permalink
Fix duotone first render in Safari (#36754)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajlende authored Nov 24, 2021
1 parent 63f4489 commit 5cf67a8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/block-supports/duotone.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 5cf67a8

Please sign in to comment.