Changeset 52768
- Timestamp:
- 02/17/2022 08:43:39 PM (3 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/block-supports/duotone.php
r52757 r52768 585 585 ); 586 586 add_filter( 'render_block', 'wp_render_duotone_support', 10, 2 ); 587 588 /**589 * Render the SVG filters supplied by theme.json.590 *591 * Note that this doesn't render the per-block user-defined592 * filters which are handled by wp_render_duotone_support,593 * but it should be rendered in the same location as those to satisfy594 * Safari's rendering quirks.595 *596 * @since 5.9.1597 */598 function wp_global_styles_render_svg_filters() {599 $filters = wp_get_global_styles_svg_filters();600 if ( ! empty( $filters ) ) {601 echo $filters;602 }603 }604 add_action( 'wp_body_open', 'wp_global_styles_render_svg_filters' ); -
trunk/src/wp-includes/default-filters.php
r52593 r52768 575 575 add_action( 'wp_footer', 'wp_enqueue_global_styles', 1 ); 576 576 577 // SVG filters like duotone have to be loaded at the beginning of the body in both admin and the front-end. 578 add_action( 'wp_body_open', 'wp_global_styles_render_svg_filters' ); 579 add_action( 'in_admin_header', 'wp_global_styles_render_svg_filters' ); 580 577 581 add_action( 'wp_default_styles', 'wp_default_styles' ); 578 582 add_filter( 'style_loader_src', 'wp_style_loader_src', 10, 2 ); -
trunk/src/wp-includes/script-loader.php
r52754 r52768 2338 2338 2339 2339 /** 2340 * Render the SVG filters supplied by theme.json. 2341 * 2342 * Note that this doesn't render the per-block user-defined 2343 * filters which are handled by wp_render_duotone_support, 2344 * but it should be rendered before the filtered content 2345 * in the body to satisfy Safari's rendering quirks. 2346 * 2347 * @since 5.9.1 2348 */ 2349 function wp_global_styles_render_svg_filters() { 2350 /* 2351 * When calling via the in_admin_header action, we only want to render the 2352 * SVGs on block editor pages. 2353 */ 2354 if ( 2355 is_admin() && 2356 ! get_current_screen()->is_block_editor() 2357 ) { 2358 return; 2359 } 2360 2361 $filters = wp_get_global_styles_svg_filters(); 2362 if ( ! empty( $filters ) ) { 2363 echo $filters; 2364 } 2365 } 2366 2367 /** 2340 2368 * Checks if the editor scripts and styles for all registered block types 2341 2369 * should be enqueued on the current screen.
Note: See TracChangeset
for help on using the changeset viewer.