Filter hook '{$type}_send_to_editor_url'

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

View Source

{$type}_send_to_editor_url

Filter Hook
Description
Filters the URL sent to the editor for a specific media type. The dynamic portion of the hook name, `$type`, refers to the type of media being sent. Possible hook names include: - `audio_send_to_editor_url` - `file_send_to_editor_url` - `video_send_to_editor_url`

Hook Information

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

Hook Parameters

Type Name Description
string $html HTML markup sent to the editor.
string $src Media source URL.
string $title Media title.

Usage Examples

Basic Usage
<?php
// Hook into {$type}_send_to_editor_url
add_filter('{$type}_send_to_editor_url', 'my_custom_filter', 10, 3);

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

Source Code Context

wp-admin/includes/media.php:934 - How this hook is used in WordPress core
<?php
 929  			 *
 930  			 * @param string $html  HTML markup sent to the editor.
 931  			 * @param string $src   Media source URL.
 932  			 * @param string $title Media title.
 933  			 */
 934  			$html = apply_filters( "{$type}_send_to_editor_url", $html, sanitize_url( $src ), $title );
 935  		} else {
 936  			$align = '';
 937  			$alt   = esc_attr( wp_unslash( $_POST['alt'] ) );
 938  
 939  			if ( isset( $_POST['align'] ) ) {

PHP Documentation

<?php
/**
			 * Filters the URL sent to the editor for a specific media type.
			 *
			 * The dynamic portion of the hook name, `$type`, refers to the type
			 * of media being sent.
			 *
			 * Possible hook names include:
			 *
			 *  - `audio_send_to_editor_url`
			 *  - `file_send_to_editor_url`
			 *  - `video_send_to_editor_url`
			 *
			 * @since 3.3.0
			 *
			 * @param string $html  HTML markup sent to the editor.
			 * @param string $src   Media source URL.
			 * @param string $title Media title.
			 */
Quick Info
  • Hook Type: Filter
  • Parameters: 3
  • File: wp-admin/includes/media.php
Related Hooks

Related hooks will be displayed here in future updates.