wppaste
WordPress

apply_filters( "{$adjacent}_image_link", string $output, int $attachment_id, string|int[] $size, string $text )

Since
3.5.0
Filters the adjacent image link.

Description

The dynamic portion of the hook name, $adjacent, refers to the type of adjacency, either 'next', or 'previous'.

Possible hook names include:

  • next_image_link
  • previous_image_link

Compatibility

WordPress
since 3.5.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$outputstring
Adjacent image HTML markup.
$attachment_idint
Attachment ID
$sizestring|int[]
Requested image size. Can be any registered image size name, or an array of width and height values in pixels (in that order).
$textstring
Link text.

Where this hook fires · 1

  • wp-includes/media.php:3995get_adjacent_image_link()

Source code

	 * @param string $output        Adjacent image HTML markup.	 * @param int    $attachment_id Attachment ID	 * @param string|int[] $size    Requested image size. Can be any registered image size name, or	 *                              an array of width and height values in pixels (in that order).	 * @param string $text          Link text.	 */	return apply_filters( "{$adjacent}_image_link", $output, $attachment_id, $size, $text );} /** * Displays next or previous image link that has the same post parent. * * Retrieves the current attachment object from the $post global.

Changelog

Introduced in 3.5.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 6.9.7 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.