adjacent_image_link()
Displays next or previous image link that has the same post parent.
Retrieves the current attachment object from the $post global.
No Hooks.
Returns
null. Nothing (null).
Usage
adjacent_image_link( $prev, $size, $text );
- $prev(true|false)
- Whether to display the next (false) or previous (true) link.
Default:true - $size(string|int[])
- Image size. Accepts any registered image size name, or an array of width and height values in pixels (in that order).
Default:'thumbnail' - $text(true|false)
- Link text.
Default:false
Changelog
| Since 2.5.0 | Introduced. |
adjacent_image_link() adjacent image link code WP 6.9.1
function adjacent_image_link( $prev = true, $size = 'thumbnail', $text = false ) {
echo get_adjacent_image_link( $prev, $size, $text );
}