Filter hook 'image_send_to_editor_url'

in WP Core File wp-admin/includes/media.php at line 959

View Source

image_send_to_editor_url

Filter Hook
Description
Filters the image URL sent to the editor.

Hook Information

File Location wp-admin/includes/media.php View on GitHub
Hook Type Filter
Line Number 959

Hook Parameters

Type Name Description
string $html HTML markup sent to the editor for an image.
string $src Image source URL.
string $alt Image alternate, or alt, text.
string $align The image alignment. Default 'alignnone'. Possible values include 'alignleft', 'aligncenter', 'alignright', 'alignnone'.

Usage Examples

Basic Usage
<?php
// Hook into image_send_to_editor_url
add_filter('image_send_to_editor_url', 'my_custom_filter', 10, 4);

function my_custom_filter($html, $src, $alt, $align) {
    // Your custom filtering logic here
    return $html;
}

Source Code Context

wp-admin/includes/media.php:959 - How this hook is used in WordPress core
<?php
 954  			 * @param string $src   Image source URL.
 955  			 * @param string $alt   Image alternate, or alt, text.
 956  			 * @param string $align The image alignment. Default 'alignnone'. Possible values include
 957  			 *                      'alignleft', 'aligncenter', 'alignright', 'alignnone'.
 958  			 */
 959  			$html = apply_filters( 'image_send_to_editor_url', $html, sanitize_url( $src ), $alt, $align );
 960  		}
 961  
 962  		return media_send_to_editor( $html );
 963  	}
 964  

PHP Documentation

<?php
/**
			 * Filters the image URL sent to the editor.
			 *
			 * @since 2.8.0
			 *
			 * @param string $html  HTML markup sent to the editor for an image.
			 * @param string $src   Image source URL.
			 * @param string $alt   Image alternate, or alt, text.
			 * @param string $align The image alignment. Default 'alignnone'. Possible values include
			 *                      'alignleft', 'aligncenter', 'alignright', 'alignnone'.
			 */
Quick Info
  • Hook Type: Filter
  • Parameters: 4
  • File: wp-admin/includes/media.php
Related Hooks

Related hooks will be displayed here in future updates.