Make WordPress Core


Ignore:
Timestamp:
04/12/2022 03:10:30 PM (3 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-link.php

    r52402 r53157  
    111111 */
    112112function block_core_navigation_link_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-link` block.
    118118 *
    119  * @param array $attributes The block attributes.
    120  * @param array $content The saved content.
    121  * @param array $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.
     
    194194
    195195    if ( isset( $attributes['label'] ) ) {
    196         $html .= wp_kses(
    197             $attributes['label'],
    198             array(
    199                 'code'   => array(),
    200                 'em'     => array(),
    201                 'img'    => array(
    202                     'scale' => array(),
    203                     'class' => array(),
    204                     'style' => array(),
    205                     'src'   => array(),
    206                     'alt'   => array(),
    207                 ),
    208                 's'      => array(),
    209                 'span'   => array(
    210                     'style' => array(),
    211                 ),
    212                 'strong' => array(),
    213             )
    214         );
     196        $html .= wp_kses_post( $attributes['label'] );
    215197    }
    216198
    217199    $html .= '</span>';
     200
     201    // Add description if available.
     202    if ( ! empty( $attributes['description'] ) ) {
     203        $html .= '<span class="wp-block-navigation-item__description">';
     204        $html .= wp_kses_post( $attributes['description'] );
     205        $html .= '</span>';
     206    }
     207
     208    $html .= '</a>';
     209    // End anchor tag content.
    218210
    219211    if ( isset( $block->context['showSubmenuIcon'] ) && $block->context['showSubmenuIcon'] && $has_submenu ) {
     
    221213        $html .= '<span class="wp-block-navigation__submenu-icon">' . block_core_navigation_link_render_submenu_icon() . '</span>';
    222214    }
    223 
    224     $html .= '</a>';
    225     // End anchor tag content.
    226215
    227216    if ( $has_submenu ) {
Note: See TracChangeset for help on using the changeset viewer.