adjacent_image_link( bool $prev = true, string|int[] $size = 'thumbnail', bool $text = false )

Displays next or previous image link that has the same post parent.

Description Description

Retrieves the current attachment object from the $post global.

Top ↑

Parameters Parameters


(bool) (Optional) Whether to display the next (false) or previous (true) link.

Default value: true


(string|int[]) (Optional) Image size. Accepts any registered image size name, or an array of width and height values in pixels (in that order).

Default value: 'thumbnail'


(bool) (Optional) Link text.

Default value: false

Top ↑

Source Source

File: wp-includes/media.php

function adjacent_image_link( $prev = true, $size = 'thumbnail', $text = false ) {
	echo get_adjacent_image_link( $prev, $size, $text );

Top ↑

Changelog Changelog

Version Description
2.5.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.