Make WordPress Core


Ignore:
Timestamp:
04/12/2022 03:10:30 PM (2 years ago)
Author:
gziolo
Message:

Editor: Update WordPress packages based based on Gutenberg v13.0 RC3

This is the last step of backports from the Gutenberg plugin for WordPress 6.0 Beta 1 release. It includes all updates WordPress packages published to npm based on the Gutenberg plugin v13.0 RC3 release. This patch also includes all the necessary changes applied to core blocks. New blocks included:

  • Avatar
  • Comment Author Name
  • Comment Content
  • Comment Date
  • Comment Edit Link
  • Comment Rely Link
  • Comment Template
  • Comments Pagination
  • Comments Pagination Next
  • Comments Pagination Previous
  • Comments Query Loop
  • Home Link
  • Post Author Biography
  • Query No Results
  • Read More

See more details in https://github.com/WordPress/wordpress-develop/pull/2564.

Props zieladam, ramonopoly, ocean90.
Fixes #55505.

File:
1 edited

Legend:

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

    r52551 r53157  
    111111 */
    112112function block_core_navigation_submenu_render_submenu_icon() {
    113     return '<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none" role="img" aria-hidden="true" focusable="false"><path d="M1.50002 4L6.00002 8L10.5 4" stroke-width="1.5"></path></svg>';
     113    return '<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none" aria-hidden="true" focusable="false"><path d="M1.50002 4L6.00002 8L10.5 4" stroke-width="1.5"></path></svg>';
    114114}
    115115
     
    117117 * Renders the `core/navigation-submenu` block.
    118118 *
    119  * @param array  $attributes The block attributes.
    120  * @param string $content The saved content.
    121  * @param object $block The parsed block.
     119 * @param array    $attributes The block attributes.
     120 * @param string   $content    The saved content.
     121 * @param WP_Block $block      The parsed block.
    122122 *
    123123 * @return string Returns the post content with the legacy widget added.
     
    168168
    169169    if ( isset( $attributes['label'] ) ) {
    170         $label .= wp_kses(
    171             $attributes['label'],
    172             array(
    173                 'code'   => array(),
    174                 'em'     => array(),
    175                 'img'    => array(
    176                     'scale' => array(),
    177                     'class' => array(),
    178                     'style' => array(),
    179                     'src'   => array(),
    180                     'alt'   => array(),
    181                 ),
    182                 's'      => array(),
    183                 'span'   => array(
    184                     'style' => array(),
    185                 ),
    186                 'strong' => array(),
    187             )
    188         );
     170        $label .= wp_kses_post( $attributes['label'] );
    189171    }
    190172
     
    200182    // If submenu icons are set to show, we also render a submenu button, so the submenu can be opened on click.
    201183    if ( ! $open_on_click ) {
    202         $item_url = isset( $attributes['url'] ) ? esc_url( $attributes['url'] ) : '';
     184        $item_url = isset( $attributes['url'] ) ? $attributes['url'] : '';
    203185        // Start appending HTML attributes to anchor tag.
    204         $html .= '<a class="wp-block-navigation-item__content" href="' . $item_url . '"';
     186        $html .= '<a class="wp-block-navigation-item__content" href="' . esc_url( $item_url ) . '"';
    205187
    206188        if ( $is_active ) {
     
    233215            // The submenu icon is rendered in a button here
    234216            // so that there's a clickable element to open the submenu.
    235             $html .= '<button aria-label="' . $aria_label . '" class="wp-block-navigation__submenu-icon wp-block-navigation-submenu__toggle" aria-expanded="false">' . block_core_navigation_submenu_render_submenu_icon() . '</button>';
     217            $html .= '<button aria-label="' . esc_attr( $aria_label ) . '" class="wp-block-navigation__submenu-icon wp-block-navigation-submenu__toggle" aria-expanded="false">' . block_core_navigation_submenu_render_submenu_icon() . '</button>';
    236218        }
    237219    } else {
    238220        // If menus open on click, we render the parent as a button.
    239         $html .= '<button aria-label="' . $aria_label . '" class="wp-block-navigation-item__content wp-block-navigation-submenu__toggle" aria-expanded="false">';
     221        $html .= '<button aria-label="' . esc_attr( $aria_label ) . '" class="wp-block-navigation-item__content wp-block-navigation-submenu__toggle" aria-expanded="false">';
    240222
    241223        // Wrap title with span to isolate it from submenu icon.
     
    246228        $html .= '</span>';
    247229
     230        $html .= '</button>';
     231
    248232        $html .= '<span class="wp-block-navigation__submenu-icon">' . block_core_navigation_submenu_render_submenu_icon() . '</span>';
    249 
    250         $html .= '</button>';
    251233
    252234    }
Note: See TracChangeset for help on using the changeset viewer.