Merged in feature/81-dev-dev01 (pull request #5)
auto-patch 81-dev-dev01-2023-12-05T22_45_26 * auto-patch 81-dev-dev01-2023-12-05T22_45_26
This commit is contained in:
@@ -28,12 +28,17 @@ function render_block_core_post_navigation_link( $attributes, $content ) {
|
||||
if ( isset( $attributes['textAlign'] ) ) {
|
||||
$classes .= " has-text-align-{$attributes['textAlign']}";
|
||||
}
|
||||
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) );
|
||||
$wrapper_attributes = get_block_wrapper_attributes(
|
||||
array(
|
||||
'class' => $classes,
|
||||
)
|
||||
);
|
||||
// Set default values.
|
||||
$format = '%link';
|
||||
$link = 'next' === $navigation_type ? _x( 'Next', 'label for next post link' ) : _x( 'Previous', 'label for previous post link' );
|
||||
$label = '';
|
||||
|
||||
// Only use hardcoded values here, otherwise we need to add escaping where these values are used.
|
||||
$arrow_map = array(
|
||||
'none' => '',
|
||||
'arrow' => array(
|
||||
@@ -84,13 +89,13 @@ function render_block_core_post_navigation_link( $attributes, $content ) {
|
||||
}
|
||||
|
||||
// Display arrows.
|
||||
if ( isset( $attributes['arrow'] ) && ! empty( $attributes['arrow'] ) && 'none' !== $attributes['arrow'] ) {
|
||||
if ( isset( $attributes['arrow'] ) && 'none' !== $attributes['arrow'] && isset( $arrow_map[ $attributes['arrow'] ] ) ) {
|
||||
$arrow = $arrow_map[ $attributes['arrow'] ][ $navigation_type ];
|
||||
|
||||
if ( 'next' === $navigation_type ) {
|
||||
$format = '%link <span class="wp-block-post-navigation-link__arrow-next is-arrow-' . $attributes['arrow'] . '" aria-hidden="true">' . $arrow . '</span>';
|
||||
$format = '%link<span class="wp-block-post-navigation-link__arrow-next is-arrow-' . $attributes['arrow'] . '" aria-hidden="true">' . $arrow . '</span>';
|
||||
} else {
|
||||
$format = '<span class="wp-block-post-navigation-link__arrow-previous is-arrow-' . $attributes['arrow'] . '" aria-hidden="true">' . $arrow . '</span> %link';
|
||||
$format = '<span class="wp-block-post-navigation-link__arrow-previous is-arrow-' . $attributes['arrow'] . '" aria-hidden="true">' . $arrow . '</span>%link';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user