I would like to add a new button the to Link URL options in the Media Library tab. The button should insert a short tag, but strip out the 'a href' when the custom url is inserted into the post.
This code is from /wp-admin/includes/media.php
function get_image_send_to_editor($id, $caption, $title, $align, $url='', $rel = false, $size='medium', $alt = '') {
$html = get_image_tag($id, $alt, $title, $align, $size);
$rel = $rel ? ' rel="attachment wp-att-' . esc_attr($id).'"' : '';
**if ( $url )
$html = '<a href="' . esc_attr($url) . "\"$rel>$html</a>";**
$html = apply_filters( 'image_send_to_editor', $html, $id, $caption, $title, $align, $url, $size, $alt );
return $html;
}
Can anyone help with hooking into that function, to accomplish what I'm trying to do?