next_image_link
Filters the adjacent image link.
This is one of the variants of the dynamic hook (adjacent)_image_link
Usage
add_filter( 'next_image_link', 'wp_kama_next_image_link_filter', 10, 4 );
/**
* Function for `next_image_link` filter-hook.
*
* @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 string
*/
function wp_kama_next_image_link_filter( $output, $attachment_id, $size, $text ){
// filter...
return $output;
}
- $output(string)
- Adjacent image HTML markup.
- $attachment_id(int)
- Attachment ID
- $size(string|int[])
- Requested image size. Can be any registered image size name, or an array of width and height values in pixels (in that order).
- $text(string)
- Link text.
Changelog
| Since 3.5.0 | Introduced. |
Where the hook is called
wp-includes/media.php 3995
return apply_filters( "{$adjacent}_image_link", $output, $attachment_id, $size, $text );