Filter: postie_place_media_before

This filter is called after the image/audio/video/attachment template has been filled out and the “Image Location” setting is “Before” and gives you the opportunity to change the markup referring to the media.

Parameters:
  • $html – the html fragment that will replace the placeholder. This html is based on the template specified in the settings for the file type.
  • $media_id –  the ID of the media being used to replace the placeholder.
add_filter('postie_place_media_before', 'my_postie_place_media_before', 10, 2);

function my_postie_place_media_before($html, $media_id) {
    $type = get_post_mime_type($media_id);
    if ($type == 'image/jpeg') {
        $html .= '<p>This is copyright by me</p>';
    }
    return $html;
}