I don’t really know much of PHP, I just work along with what I have.
I’m sure that what you said makes sense, however I have no clue how to make it work.
Let’s say the current tag being sent to the editor is <a href="link"><img src="link"></a>
and I want to change it to <p>miaumiau you can't insert images</p>
How exactly would the function be? Like I said, from your code I understood I could change the $content
however I wanted, but that just adds content to the end. How can I change the whole?
Basically from the core files we have this:
107 function get_image_send_to_editor($id, $caption, $title, $align, $url='', $rel = false, $size='medium', $alt = '') {
108
109 $html = get_image_tag($id, $alt, '', $align, $size);
110
111 $rel = $rel ? ' rel="attachment wp-att-' . esc_attr($id).'"' : '';
112
113 if ( $url )
114 $html = '<a href="' . esc_attr($url) . "\"$rel>$html</a>";
115
116 $html = apply_filters( 'image_send_to_editor', $html, $id, $caption, $title, $align, $url, $size, $alt );
117
118 return $html;
228 function get_image_tag($id, $alt, $title, $align, $size='medium') {
229
230 list( $img_src, $width, $height ) = image_downsize($id, $size);
231 $hwstring = image_hwstring($width, $height);
232
233 $title = $title ? 'title="' . esc_attr( $title ) . '" ' : '';
234
235 $class = 'align' . esc_attr($align) .' size-' . esc_attr($size) . ' wp-image-' . $id;
236 $class = apply_filters('get_image_tag_class', $class, $id, $align, $size);
237
238 $html = '<img src="' . esc_attr($img_src) . '" alt="' . esc_attr($alt) . '" ' . $title . $hwstring . 'class="' . $class . '" />';
239
240 $html = apply_filters( 'get_image_tag', $html, $id, $alt, $title, $align, $size );
241
242 return $html;
243 }
And I know how to change it accordingly to how I want, because the content is there.