1.8.33 Released

  • New setting “Remove matched categories” allows category specifiers to remain in post title.
  • New filter postie_cleanhtml to determine if Postie should clean up the html or if some other AddOn will do it.
  • Specifically call out public methods

1.8.32 Released

  • Ensure password not in logs for POP3.
  • Additional POP3 header checks.
  • Additional POP3 logging.
  • Ensure postie_raw always gets called.
  • Default to GMT when timezone is blank.
  • Use WordPress function to upload images rather than old custom function.
  • Remove Generate Thumbnails option as now handled by WordPress.
  • ATT00001.txt and its ilk are now always considered a banned attachment regardless of MIME type.
  • Removed call to date_default_timezone_set()
  • Send notifications to all WP admins if configured.
  • Add support for postie_category filter.

Filter: postie_category

This filter is called after the category is detected in the subject line. You could use this filter to create a missing category or force it to be one of a list of approved categories. Note this filter will be called multiple times if there are multiple categories in the subject line.

You should return a string that is a valid category or taxonomy term. If the returned value is not a valid category or taxonomy term then the unknown category will remain in the subject line.

Parameters:
  • $category_name – the category extracted from the subject line. Note this could be a category ID. The delimiters are not included e.g. for the subject line “[mycategory] subject line” this parameter would be “mycategory”
  • $match_short_category – a boolean indicating if Postie will try to look up the category using “starts with” logic. Controlled by the “Match short category” setting.
  • $default – the default category as defined by the “Default category” setting or the results of the postie_category_default filter.
add_filter('postie_category', 'my_postie_category', 10, 3);

function my_postie_category($category_name, $match_short_category, $default) {
 return ''; //don't allow user to set category
}

1.8.33 Released

  • Ensure password not in logs for POP3.
  • Additional POP3 header checks.
  • Additional POP3 logging.
  • Ensure postie_raw always gets called.
  • Default to GMT when timezone is blank.
  • Use WordPress function to upload images rather than old custom function.
  • Remove Generate Thumbnails option as now handled by WordPress.
  • ATT00001.txt and its ilk are now always considered a banned attachment regardless of MIME type.
  • Removed call to date_default_timezone_set()
  • Send notifications to all WP admins if configured.
  • Add support for postie_category filter.

Shortcode AddOn enhanced

The most recent release of the Shortcode AddOn has been enhanced to support setting array elements in the pcustom shortcode.

A number of other plugins add custom fields to posts to support their specific functionality. Some of the plugins use arrays rather than multiple simple values. This update allows you to set the array element values in those cases.

For example:

[pcustom name="myarray{name}" value="Wayne"]
[pcustom name="myarray{email}" value="wayne@postieplugin.com"]

This will set the element “name” of myarray to “wayne” and the element “email” of myarray to “wayne@postieplugin.com”

This is the PHP equivalent of:

$myarray['name'] = 'Wayne';
$myarray['email'] = 'wayne@postieplugin.com';

Because WordPress does not allow square brackets (“[” and “]”) in shortcode values Postie uses curly brackets instead.

Filter: postie_bare_link

This filter is called for each bare link Postie finds in your message. Bare links are plain URLs without any markup. I.e. “http://www.example.com” is a bare link. “Not a bare link” is not a bare link. Note some email clients will transform bare links into non-bare links especially if you are using rich text/html. Generally if you want to take advantage of this filter consistently you will want to set Preferred Text Type to Plain.

Parameters:

  • $html – the html that will be inserted into the post.
  • $URL – the original URL (bare link).
  • $oembed – whether WordPress thinks this bare link can be handled by the “Easy Embed” feature. See https://codex.wordpress.org/Embeds

You must return a string that will be placed at the spot where the bare URL was found.

Example

add_filter('postie_bare_link', 'my_postie_bare_link', 10, 3);

function my_postie_bare_link($html, $url, $oembed) {
    if ($oembed)
        return htmlspecialchars($url);
    else
        return "<div class='mylinkclass'>$html</div>";
}