Make WordPress Core


Ignore:
Timestamp:
07/14/2026 05:03:51 PM (3 months ago)
Author:
wildworks
Message:

General: Bump the pinned hash for Gutenberg to v23.5.0.

This updates the pinned commit hash of the Gutenberg repository from 98a796c8780c480ef7bcfe03c42302d9564d785c (version 23.4.0) to b5574edc8a952b2f1e528693761a97b1b3b580eb (version 23.5.0).

A full list of changes included in this commit can be found on GitHub: ​https://github.com/WordPress/gutenberg/compare/v23.4.0..v23.5.0.

The following commits are included:

Props desrosj, wildworks.
Fixes #65589.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/blocks/icon.php

    r62577 r62738  
    1717function render_block_core_icon( $attributes ) {
    1818        if ( empty( $attributes['icon'] ) ) {
    19                 return;
    20         }
    21 
    22         $registry = WP_Icons_Registry::get_instance();
    23         $icon     = $registry->get_registered_icon( $attributes['icon'] );
    24 
    25         if ( is_null( $icon ) ) {
    2619                return;
    2720        }
    … …  
    8780        );
    8881
    89         $processor = new WP_HTML_Tag_Processor( $icon['content'] );
    90         $processor->next_tag( 'svg' );
     82        $svg = wp_get_icon(
     83                $attributes['icon'],
     84                array(
     85                        // Width is applied via the dimensions block support styles below.
     86                        'size'  => null,
     87                        'class' => $styles['classnames'] ?? '',
     88                        'label' => $attributes['ariaLabel'] ?? '',
     89                )
     90        );
    9191
    92         if ( ! empty( $styles['css'] ) ) {
    93                 $processor->set_attribute( 'style', $styles['css'] );
    94         }
    95         if ( ! empty( $styles['classnames'] ) ) {
    96                 $processor->add_class( $styles['classnames'] );
     92        if ( '' === $svg ) {
     93                return;
    9794        }
    9895
    99         $aria_label = ! empty( $attributes['ariaLabel'] ) ? $attributes['ariaLabel'] : '';
     96        $processor = new WP_HTML_Tag_Processor( $svg );
     97        if ( $processor->next_tag( 'svg' ) ) {
     98                if ( ! empty( $styles['css'] ) ) {
     99                        $processor->set_attribute( 'style', $styles['css'] );
     100                }
    100101
    101         if ( ! $aria_label ) {
    102                 // Icon is decorative, hide it from screen readers.
    103                 $processor->set_attribute( 'aria-hidden', 'true' );
    104                 $processor->set_attribute( 'focusable', 'false' );
    105         } else {
    106                 $processor->set_attribute( 'role', 'img' );
    107                 $processor->set_attribute( 'aria-label', $aria_label );
     102                // Apply flip classes to the SVG.
     103                $flip_horizontal = $attributes['flipHorizontal'] ?? false;
     104                $flip_vertical   = $attributes['flipVertical'] ?? false;
     105
     106                if ( $flip_horizontal ) {
     107                        $processor->add_class( 'is-flip-horizontal' );
     108                }
     109                if ( $flip_vertical ) {
     110                        $processor->add_class( 'is-flip-vertical' );
     111                }
     112
     113                $rotation = isset( $attributes['rotation'] ) ? (int) $attributes['rotation'] : 0;
     114
     115                if ( $rotation ) {
     116                        $current_style = $processor->get_attribute( 'style' ) ?? '';
     117                        $rotation_css  = 'rotate: ' . $rotation . 'deg;';
     118                        if ( $current_style ) {
     119                                $processor->set_attribute( 'style', $current_style . ' ' . $rotation_css );
     120                        } else {
     121                                $processor->set_attribute( 'style', $rotation_css );
     122                        }
     123                }
     124
     125                $svg = $processor->get_updated_html();
    108126        }
    109127
    110         // Return the updated SVG markup.
    111         $svg        = $processor->get_updated_html();
    112         $attributes = get_block_wrapper_attributes();
    113         return sprintf( '<div %s>%s</div>', $attributes, $svg );
     128        $wrapper_attributes = get_block_wrapper_attributes();
     129        return sprintf( '<div %s>%s</div>', $wrapper_attributes, $svg );
    114130}
    115131
Note: See TracChangeset for help on using the changeset viewer.