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/archives.php

    r52042 r53157  
    1717function render_block_core_archives( $attributes ) {
    1818    $show_post_count = ! empty( $attributes['showPostCounts'] );
    19 
    20     $class = '';
     19    $type            = isset( $attributes['type'] ) ? $attributes['type'] : 'monthly';
     20    $class           = '';
    2121
    2222    if ( ! empty( $attributes['displayAsDropdown'] ) ) {
     
    2424        $class .= ' wp-block-archives-dropdown';
    2525
    26         $dropdown_id = esc_attr( uniqid( 'wp-block-archives-' ) );
     26        $dropdown_id = wp_unique_id( 'wp-block-archives-' );
    2727        $title       = __( 'Archives' );
    2828
     
    3131            'widget_archives_dropdown_args',
    3232            array(
    33                 'type'            => 'monthly',
     33                'type'            => $type,
    3434                'format'          => 'option',
    3535                'show_post_count' => $show_post_count,
     
    6363        }
    6464
    65         $label = esc_html( $label );
    66 
    67         $block_content = '<label for="' . $dropdown_id . '">' . $title . '</label>
    68     <select id="' . $dropdown_id . '" name="archive-dropdown" onchange="document.location.href=this.options[this.selectedIndex].value;">
    69     <option value="">' . $label . '</option>' . $archives . '</select>';
     65        $block_content = '<label for="' . esc_attr( $dropdown_id ) . '">' . esc_html( $title ) . '</label>
     66    <select id="' . esc_attr( $dropdown_id ) . '" name="archive-dropdown" onchange="document.location.href=this.options[this.selectedIndex].value;">
     67    <option value="">' . esc_html( $label ) . '</option>' . $archives . '</select>';
    7068
    7169        return sprintf(
     
    8280        'widget_archives_args',
    8381        array(
    84             'type'            => 'monthly',
     82            'type'            => $type,
    8583            'show_post_count' => $show_post_count,
    8684        )
     
    9189    $archives = wp_get_archives( $archives_args );
    9290
    93     $classnames = esc_attr( $class );
    94 
    95     $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classnames ) );
     91    $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $class ) );
    9692
    9793    if ( empty( $archives ) ) {
Note: See TracChangeset for help on using the changeset viewer.