(adjacent)_image_link
Filters the adjacent image link.
The dynamic portion of the hook name, $adjacent, refers to the type of adjacency, either 'next', or 'previous'.
Possible hook names include:
Использование
add_filter( '(adjacent)_image_link', 'wp_kama_adjacent_image_link_filter', 10, 4 );
/**
* Function for `(adjacent)_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_adjacent_image_link_filter( $output, $attachment_id, $size, $text ){
// filter...
return $output;
}
- $output(строка)
- Adjacent image HTML markup.
- $attachment_id(int)
- Attachment ID
- $size(строка|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(строка)
- Link text.
Список изменений
| С версии 3.5.0 | Введена. |
Где вызывается хук
wp-includes/media.php 3995
return apply_filters( "{$adjacent}_image_link", $output, $attachment_id, $size, $text );