From 30883c26bdceb9eaf32c8d4a1b0c1bce223b5226 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 09:57:26 +0200 Subject: Adding upstream version 6.5+dfsg1. Signed-off-by: Daniel Baumann --- wp-includes/blocks/post-navigation-link.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'wp-includes/blocks/post-navigation-link.php') diff --git a/wp-includes/blocks/post-navigation-link.php b/wp-includes/blocks/post-navigation-link.php index add112c..5bbc87e 100644 --- a/wp-includes/blocks/post-navigation-link.php +++ b/wp-includes/blocks/post-navigation-link.php @@ -99,10 +99,21 @@ function render_block_core_post_navigation_link( $attributes, $content ) { } } - // The dynamic portion of the function name, `$navigation_type`, - // refers to the type of adjacency, 'next' or 'previous'. + /* + * The dynamic portion of the function name, `$navigation_type`, + * Refers to the type of adjacency, 'next' or 'previous'. + * + * @see https://developer.wordpress.org/reference/functions/get_previous_post_link/ + * @see https://developer.wordpress.org/reference/functions/get_next_post_link/ + */ $get_link_function = "get_{$navigation_type}_post_link"; - $content = $get_link_function( $format, $link ); + + if ( ! empty( $attributes['taxonomy'] ) ) { + $content = $get_link_function( $format, $link, true, '', $attributes['taxonomy'] ); + } else { + $content = $get_link_function( $format, $link ); + } + return sprintf( '
%2$s
', $wrapper_attributes, -- cgit v1.2.3