Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add link to Post navigation block arrow icon #67554

Open
wants to merge 4 commits into
base: trunk
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions packages/block-library/src/post-navigation-link/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,19 @@ function render_block_core_post_navigation_link( $attributes, $content ) {
$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>';
$link = sprintf(
'<span class="post-navigation-link__title">%s</span><span class="wp-block-post-navigation-link__arrow-next is-arrow-%s" aria-hidden="true">%s</span>',
$link,
esc_attr( $attributes['arrow'] ),
esc_html( $arrow )
);
} else {
$format = '<span class="wp-block-post-navigation-link__arrow-previous is-arrow-' . $attributes['arrow'] . '" aria-hidden="true">' . $arrow . '</span>%link';
$link = sprintf(
'<span class="wp-block-post-navigation-link__arrow-previous is-arrow-%s" aria-hidden="true">%s</span><span class="post-navigation-link__title">%s</span>',
esc_attr( $attributes['arrow'] ),
esc_html( $arrow ),
$link
);
}
}

Expand Down
Loading