Make WordPress Core


Ignore:
Timestamp:
06/29/2023 06:19:41 AM (12 months ago)
Author:
isabel_brison
Message:

Editor: update duotone support.

Updates duotone support after stabilisation of selectors API and adds a few small code quality and UI improvements.

Props onemaggie, peterwilsoncc, ajlende, audrasjb, mikeschroder, ramonopoly.
Fixes #58555.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/script-loader.php

    r56064 r56101  
    24812481
    24822482/**
    2483  * Renders the SVG filters supplied by theme.json.
    2484  *
    2485  * Note that this doesn't render the per-block user-defined
    2486  * filters which are handled by wp_render_duotone_support,
    2487  * but it should be rendered before the filtered content
    2488  * in the body to satisfy Safari's rendering quirks.
    2489  *
    2490  * @since 5.9.1
    2491  */
    2492 function wp_global_styles_render_svg_filters() {
    2493     /*
    2494      * When calling via the in_admin_header action, we only want to render the
    2495      * SVGs on block editor pages.
    2496      */
    2497     if (
    2498         is_admin() &&
    2499         ! get_current_screen()->is_block_editor()
    2500     ) {
    2501         return;
    2502     }
    2503 
    2504     $filters = wp_get_global_styles_svg_filters();
    2505     if ( ! empty( $filters ) ) {
    2506         echo $filters;
    2507     }
    2508 }
    2509 
    2510 /**
    25112483 * Checks if the editor scripts and styles for all registered block types
    25122484 * should be enqueued on the current screen.
Note: See TracChangeset for help on using the changeset viewer.