summaryrefslogtreecommitdiffstats
path: root/wp-includes/blocks/post-navigation-link.php
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 07:57:30 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 07:57:30 +0000
commitfa9a33d818470a5796f0ff8797f98b510ed8de18 (patch)
treebde6a1eede376f9b5df5898ce812330152984d8e /wp-includes/blocks/post-navigation-link.php
parentReleasing progress-linux version 6.4.3+dfsg1-1~progress7.99u1. (diff)
downloadwordpress-fa9a33d818470a5796f0ff8797f98b510ed8de18.tar.xz
wordpress-fa9a33d818470a5796f0ff8797f98b510ed8de18.zip
Merging upstream version 6.5+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--wp-includes/blocks/post-navigation-link.php17
1 files changed, 14 insertions, 3 deletions
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(
'<div %1$s>%2$s</div>',
$wrapper_attributes,