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

    r52765 r53157  
    3434    $show_input       = ( ! empty( $attributes['buttonPosition'] ) && 'button-only' === $attributes['buttonPosition'] ) ? false : true;
    3535    $show_button      = ( ! empty( $attributes['buttonPosition'] ) && 'no-button' === $attributes['buttonPosition'] ) ? false : true;
    36     $label_markup     = '';
    3736    $input_markup     = '';
    3837    $button_markup    = '';
     
    7473        $button_internal_markup = '';
    7574        $button_classes         = $color_classes;
     75        $aria_label             = '';
    7676
    7777        if ( ! $is_button_inside ) {
     
    8383            }
    8484        } else {
    85             $button_classes        .= ' has-icon';
     85            $aria_label      = sprintf( 'aria-label="%s"', esc_attr( wp_strip_all_tags( $attributes['buttonText'] ) ) );
     86            $button_classes .= ' has-icon';
     87
    8688            $button_internal_markup =
    8789                '<svg id="search-icon" class="search-icon" viewBox="0 0 24 24" width="24" height="24">
    88                     <path d="M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"></path>
    89                 </svg>';
     90                    <path d="M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"></path>
     91                </svg>';
    9092        }
    9193
    9294        $button_markup = sprintf(
    93             '<button type="submit" class="wp-block-search__button %s" %s>%s</button>',
     95            '<button type="submit" class="wp-block-search__button %s" %s %s>%s</button>',
    9496            esc_attr( $button_classes ),
    9597            $inline_styles['button'],
     98            $aria_label,
    9699            $button_internal_markup
    97100        );
     
    181184 */
    182185function styles_for_block_core_search( $attributes ) {
    183     $wrapper_styles = array();
    184     $button_styles  = array();
    185     $input_styles   = array();
     186    $wrapper_styles   = array();
     187    $button_styles    = array();
     188    $input_styles     = array();
     189    $is_button_inside = ! empty( $attributes['buttonPosition'] ) &&
     190        'button-inside' === $attributes['buttonPosition'];
    186191
    187192    // Add width styles.
     
    197202    }
    198203
     204    // Add border width styles.
     205    $has_border_width = ! empty( $attributes['style']['border']['width'] );
     206
     207    if ( $has_border_width ) {
     208        $border_width = $attributes['style']['border']['width'];
     209
     210        if ( $is_button_inside ) {
     211            $wrapper_styles[] = sprintf( 'border-width: %s;', esc_attr( $border_width ) );
     212        } else {
     213            $button_styles[] = sprintf( 'border-width: %s;', esc_attr( $border_width ) );
     214            $input_styles[]  = sprintf( 'border-width: %s;', esc_attr( $border_width ) );
     215        }
     216    }
     217
    199218    // Add border radius styles.
    200219    $has_border_radius = ! empty( $attributes['style']['border']['radius'] );
     
    203222        $default_padding = '4px';
    204223        $border_radius   = $attributes['style']['border']['radius'];
    205         // Apply wrapper border radius if button placed inside.
    206         $is_button_inside = ! empty( $attributes['buttonPosition'] ) &&
    207             'button-inside' === $attributes['buttonPosition'];
    208224
    209225        if ( is_array( $border_radius ) ) {
     
    258274
    259275    if ( $has_border_color ) {
    260         $border_color     = $attributes['style']['border']['color'];
    261         $is_button_inside = ! empty( $attributes['buttonPosition'] ) &&
    262             'button-inside' === $attributes['buttonPosition'];
     276        $border_color = $attributes['style']['border']['color'];
    263277
    264278        // Apply wrapper border color if button placed inside.
Note: See TracChangeset for help on using the changeset viewer.