image_send_to_editor_url

Filters the image URL sent to the editor.

Description

apply_filters( 'image_send_to_editor_url', (string) $html, (string) $esc_url_raw, (string) $alt, (string) $align ); 

Parameters (4)

0. $html (string)
HTML markup sent to the editor for an image.
1. $esc_url_raw (string) => esc_url_raw( $src )
Image source URL.
2. $alt (string)
Image alternate, or alt, text.
3. $align (string)
The image alignment. Default alignnone.. Possible values include alignleft,, aligncenter, alignright, alignnone..

Usage

To run the hook, copy the example below.
  1. $html = apply_filters( 'image_send_to_editor_url', $html, $esc_url_raw, $alt, $align ); 
  2.  
  3. if ( !empty( $html ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the image_send_to_editor_url callback 
  2. function filter_image_send_to_editor_url( $html, $esc_url_raw, $alt, $align ) { 
  3. // make filter magic happen here... 
  4. return $html
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'image_send_to_editor_url', 'filter_image_send_to_editor_url', 10, 4 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'image_send_to_editor_url', 'filter_image_send_to_editor_url', 10, 4 ); 

Defined (1)

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

/wp-admin/includes/media.php  
  1. $html = apply_filters( 'image_send_to_editor_url', $html, esc_url_raw( $src ), $alt, $align );