Skip to content

Commit 2ea31b1

Browse files
Docs: Correct type for the $post parameter of the {$adjacent}_post_link filter.
The parameter was documented as `WP_Post`, but it contains the value of `get_adjacent_post()`, which returns an empty string if there is no corresponding post, so the correct type is `WP_Post|string`. Follow-up to [11243], [16951], [28111], [32606]. Props apermo, audrasjb. Fixes #57047. git-svn-id: https://develop.svn.wordpress.org/trunk@54841 602fd350-edb4-49c9-b593-d223f7449a82
1 parent e67535d commit 2ea31b1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/wp-includes/link-template.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2318,11 +2318,11 @@ function get_adjacent_post_link( $format, $link, $in_same_term = false, $exclude
23182318
* @since 2.6.0
23192319
* @since 4.2.0 Added the `$adjacent` parameter.
23202320
*
2321-
* @param string $output The adjacent post link.
2322-
* @param string $format Link anchor format.
2323-
* @param string $link Link permalink format.
2324-
* @param WP_Post $post The adjacent post.
2325-
* @param string $adjacent Whether the post is previous or next.
2321+
* @param string $output The adjacent post link.
2322+
* @param string $format Link anchor format.
2323+
* @param string $link Link permalink format.
2324+
* @param WP_Post|string $post The adjacent post. Empty string if no corresponding post exists.
2325+
* @param string $adjacent Whether the post is previous or next.
23262326
*/
23272327
return apply_filters( "{$adjacent}_post_link", $output, $format, $link, $post, $adjacent );
23282328
}

0 commit comments

Comments
 (0)