Changeset 55246 for trunk/src/wp-includes/blocks/post-navigation-link.php
- Timestamp:
- 02/07/2023 07:01:56 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks/post-navigation-link.php
r53157 r55246 34 34 $link = 'next' === $navigation_type ? _x( 'Next', 'label for next post link' ) : _x( 'Previous', 'label for previous post link' ); 35 35 $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 ); 36 48 37 49 // If a custom label is provided, make this a link. … … 72 84 } 73 85 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 74 97 // The dynamic portion of the function name, `$navigation_type`, 75 98 // refers to the type of adjacency, 'next' or 'previous'.
Note:
See TracChangeset
for help on using the changeset viewer.