Filter: postie_place_media_after

This filter is called after the image/audio/video/attachment template has been filled out and the “Image Location” setting is “After” 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_after', 'my_postie_place_media_after', 10, 2);

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

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;
}

Filter: postie_place_media

This filter is called before the palceholder (#img1#) is replaced with html markup.

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 (image) being used to replace the placeholder.
add_filter('postie_place_media', 'my_postie_place_media', 10, 2);

function my_postie_place_media($html, $media_id) {
    return $html . '<p>This image is copyright by me</p>';
}

1.8.9 Released

  • Fix bug when calling new postie_email_* filters
  • Fix bug where inline and related attachments were not being considered for #img#

1.8.8 Released

  • Fix bug where success/fail email notifications had missing info.
  • Fix bug where galley wan’t being inserted on some plain text messages
  • Enhance auto linkification to recognize links like <http://example.com/>
  • Separate success and failure emails.
  • Fix readme
  • New filter: postie_email_reject_recipients – allows recipients list to be altered when sending failure message
  • New filter: postie_email_reject_subject – allows the subject to be altered when sending failure message
  • New filter: postie_email_reject_body – allows message content to be altered when sending failure message
  • New filter: postie_email_notify_recipients – allows recipients list to be altered when sending success message
  • New filter: postie_email_notify_subject – allows the subject to be altered when sending success message
  • New filter: postie_email_notify_body – allows message content to be altered when sending success message

Filter: postie_email_notify_body

This filter is called before a success notification email is sent and can be used to modify the message body.

Parameters:
  • $body – a string that is the email body. The email is sent as text/plain so HTML is not supported.
  • $postemail – an array that represents the parsed email. See filter: postie_post_pre for more details.
  • $postid – the id of the post that has been created.
add_filter('postie_email_notify_body', 'my_postie_email_notify_body', 10, 3);

function my_postie_email_notify_body($body, $postemail, $postid) {
 return $body . "\nDieser Beitrag wurde abgelehnt";
}

Filter: postie_email_reject_body

This filter is called before a reject notification email is sent and can be used to modify the message body.

At the point the filter is called there is no post created.
Parameters:
  • $body – a string that is the email body. The email is sent as text/plain so HTML is not supported.
  • $postemail – an array that represents the parsed email. See filter: postie_post_pre for more details.
add_filter('postie_email_reject_body', 'my_postie_email_reject_body', 10, 2);

function my_postie_email_reject_body($body, $postemail) {
 return $body . "\nDieser Beitrag wurde abgelehnt";
}

Filter: postie_email_notify_subject

This filter is called before a success notification email is sent and can be used to modify the subject line.

Parameters:
  • $subject – a string that is the email subject.
  • $postemail – an array that represents the parsed email. See filter: postie_post_pre for more details.
  • $postid – the id of the post that has been created.
add_filter('postie_email_notify_subject', 'my_postie_email_notify_subject', 10, 3);

function my_postie_email_notify_subject($subject, $postemail, $postid) {
 return $subject . ' / Dieser Beitrag wurde geschrieben';
}