<adjacent>_image_link

Filters the adjacent image link.

Description

apply_filters( '<adjacent>_image_link', (string) $output, (int) $attachment_id, (string) $size, (string) $text ); 

The dynamic portion(s) of the hook name refer to the type of adjacency, either next,, or previous..

Parameters (4)

0. $output (string)
Adjacent image HTML markup.
1. $attachment_id (int)
The attachment id.
2. $size (string)
Image size.
3. $text (string)
Link text.

Usage

To run the hook, copy the example below.
  1. $output = apply_filters( '{$adjacent}_image_link', $output, $attachment_id, $size, $text ); 
  2.  
  3. if ( !empty( $output ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the <adjacent>_image_link callback 
  2. function filter_adjacent_image_link( $output, $attachment_id, $size, $text ) { 
  3. // make filter magic happen here... 
  4. return $output
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( "{$adjacent}_image_link", 'filter_adjacent_image_link', 10, 4 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( "{$adjacent}_image_link", 'filter_adjacent_image_link', 10, 4 ); 

Defined (1)

The filter is defined in the following location(s).

/wp-includes/media.php  
  1. echo apply_filters( "{$adjacent}_image_link", $output, $attachment_id, $size, $text );