Make WordPress Core


Ignore:
Timestamp:
02/07/2023 07:01:56 AM (4 years ago)
Author:
youknowriad
Message:

Block Editor: Updated the WordPress packages to include Gutenberg 15.1.0 changes.

In addition to all the packages being updated to the latest versions,
this commit also includes some mandatory changes to avoid editor breakage:

  • Update React to to 18.2.0.
  • Add the right stylesheets to support iframed block editors.

Props ntsekouras, mamaduka, flixos90, desrosj, peterwilsoncc.
See #57471.

File:
1 edited

Legend:

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

    r53157 r55246  
    3434        $link   = 'next' === $navigation_type ? _x( 'Next', 'label for next post link' ) : _x( 'Previous', 'label for previous post link' );
    3535        $label  = '';
     36
     37        $arrow_map = array(
     38                'none'    => '',
     39                'arrow'   => array(
     40                        'next'     => '→',
     41                        'previous' => '←',
     42                ),
     43                'chevron' => array(
     44                        'next'     => '»',
     45                        'previous' => '«',
     46                ),
     47        );
    3648
    3749        // If a custom label is provided, make this a link.
    … …  
    7284        }
    7385
     86        // Display arrows.
     87        if ( isset( $attributes['arrow'] ) && ! empty( $attributes['arrow'] ) && 'none' !== $attributes['arrow'] ) {
     88                $arrow = $arrow_map[ $attributes['arrow'] ][ $navigation_type ];
     89
     90                if ( 'next' === $navigation_type ) {
     91                        $format = '%link <span class="wp-block-post-navigation-link__arrow-next is-arrow-' . $attributes['arrow'] . '" aria-hidden="true">' . $arrow . '</span>';
     92                } else {
     93                        $format = '<span class="wp-block-post-navigation-link__arrow-previous is-arrow-' . $attributes['arrow'] . '" aria-hidden="true">' . $arrow . '</span> %link';
     94                }
     95        }
     96
    7497        // The dynamic portion of the function name, `$navigation_type`,
    7598        // refers to the type of adjacency, 'next' or 'previous'.
Note: See TracChangeset for help on using the changeset viewer.