function test_function( $html ) {
   return $html . 'TEST!';
}
add_filter( 'post_thumbnail_html', 'test_function', 21 );
add_filter( 'image_send_to_editor', 'test_function', 21 );
add_filter( 'media_send_to_editor', 'test_function', 21 );

I’ve tried something like the above, but it only edits the HTML of images appended thru the media library, not ones added manually via URL. The goal here is to modify the tag produced so I can add some additional attributes to it. Any ideas?

Read more here: When adding media, can I filter the HTML generated from "Insert From URL" before it hits the editor?


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Related Wordpress search:

, , , , , , , ,

Wordpress related questions and answers: