Postie - Version 1.8.10

Version Description

(2016-10-24) = * New filter postie_place_media - allows markup to be changed when #img# references are being replaced. * New filter postie_place_media_before - allows markup to be changed when attachment templates are placed before the content. * New filter postie_place_media_after - allows markup to be changed when attachment templates are placed after the content.

Download this release

Release Info

Developer WayneAllen
Plugin Icon 128x128 Postie
Version 1.8.10
Comparing to
See all releases

Code changes from version 1.8.9 to 1.8.10

Files changed (5) hide show
  1. docs/Changes.txt +6 -1
  2. docs/Postie.txt +1 -1
  3. postie-functions.php +22 -5
  4. postie.php +3 -3
  5. readme.txt +8 -2
docs/Changes.txt CHANGED
@@ -32,7 +32,12 @@ All script, style and body tags are stripped from html emails.
32
  Attachments are now processed in the order they were attached.
33
 
34
  == CHANGELOG ==
35
- = 1.8.8 (2016-10-23) =
 
 
 
 
 
36
  * Fix bug when calling new postie_email_* filters
37
  * Fix bug where inline and related attachments were not being considered for #img#
38
 
32
  Attachments are now processed in the order they were attached.
33
 
34
  == CHANGELOG ==
35
+ = 1.8.10 (2016-10-24) =
36
+ * New filter postie_place_media - allows markup to be changed when #img# references are being replaced.
37
+ * New filter postie_place_media_before - allows markup to be changed when attachment templates are placed before the content.
38
+ * New filter postie_place_media_after - allows markup to be changed when attachment templates are placed after the content.
39
+
40
+ = 1.8.9 (2016-10-23) =
41
  * Fix bug when calling new postie_email_* filters
42
  * Fix bug where inline and related attachments were not being considered for #img#
43
 
docs/Postie.txt CHANGED
@@ -6,7 +6,7 @@ Plugin URI: http://PostiePlugin.com/
6
  Tags: e-mail, email, post-by-email
7
  Requires at least: 3.3.0
8
  Tested up to: 4.6.1
9
- Stable tag: 1.8.9
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
6
  Tags: e-mail, email, post-by-email
7
  Requires at least: 3.3.0
8
  Tested up to: 4.6.1
9
+ Stable tag: 1.8.10
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
postie-functions.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /*
3
- $Id: postie-functions.php 1520721 2016-10-24 03:07:59Z WayneAllen $
4
  */
5
 
6
  class PostiePostModifiers {
@@ -221,7 +221,14 @@ function filter_AttachmentTemplates($content, $mimeDecodedEmail, $post_id, $conf
221
  if (!$addimages && $attachment['primary'] == 'image') {
222
  DebugEcho("filter_AttachmentTemplates: skip image " . $attachment['filename']);
223
  } else {
224
- $html .= $attachment['template'];
 
 
 
 
 
 
 
225
  }
226
  } else {
227
  DebugEcho("filter_AttachmentTemplates: skip attachment " . $attachment['filename']);
@@ -236,7 +243,14 @@ function filter_AttachmentTemplates($content, $mimeDecodedEmail, $post_id, $conf
236
  if (!$addimages && $attachment['primary'] == 'image') {
237
  DebugEcho("filter_AttachmentTemplates: skip image (alt) " . $attachment['filename']);
238
  } else {
239
- $html .= $attachment['template'];
 
 
 
 
 
 
 
240
  }
241
  } else {
242
  DebugEcho("filter_AttachmentTemplates: skip attachment (alt) " . $attachment['filename']);
@@ -2136,12 +2150,15 @@ function filter_ReplaceImagePlaceHolders_worker($content, &$attachment, $imagePa
2136
  } else {
2137
  DebugEcho("filter_ReplaceImagePlaceHolders_worker: No caption found");
2138
  }
2139
- DebugEcho("filter_ReplaceImagePlaceHolders_worker: parameterize templete: " . $imageTemplate);
2140
  $imageTemplate = mb_str_replace('{CAPTION}', htmlspecialchars($caption, ENT_QUOTES), $imageTemplate);
2141
- DebugEcho("filter_ReplaceImagePlaceHolders_worker: captioned template: " . $imageTemplate);
2142
 
2143
  $img_placeholder_temp .= '#';
2144
 
 
 
 
2145
  $content = str_ireplace($img_placeholder_temp, $imageTemplate, $content);
2146
  DebugEcho("filter_ReplaceImagePlaceHolders_worker: post replace: $content");
2147
  }
1
  <?php
2
  /*
3
+ $Id: postie-functions.php 1521268 2016-10-24 17:27:21Z WayneAllen $
4
  */
5
 
6
  class PostiePostModifiers {
221
  if (!$addimages && $attachment['primary'] == 'image') {
222
  DebugEcho("filter_AttachmentTemplates: skip image " . $attachment['filename']);
223
  } else {
224
+ $template = $attachment['template'];
225
+ if ($config['images_append']) {
226
+ $template = apply_filters('postie_place_media_before', $template, $attachment['wp_id']);
227
+ } else {
228
+ $template = apply_filters('postie_place_media_after', $template, $attachment['wp_id']);
229
+ }
230
+ DebugEcho("filter_AttachmentTemplates: post filter '$template'");
231
+ $html .= $template;
232
  }
233
  } else {
234
  DebugEcho("filter_AttachmentTemplates: skip attachment " . $attachment['filename']);
243
  if (!$addimages && $attachment['primary'] == 'image') {
244
  DebugEcho("filter_AttachmentTemplates: skip image (alt) " . $attachment['filename']);
245
  } else {
246
+ $template = $attachment['template'];
247
+ if ($config['images_append']) {
248
+ $template = apply_filters('postie_place_media_before', $template, $attachment['wp_id']);
249
+ } else {
250
+ $template = apply_filters('postie_place_media_after', $template, $attachment['wp_id']);
251
+ }
252
+ DebugEcho("filter_AttachmentTemplates: post filter (alt) '$template'");
253
+ $html .= $template;
254
  }
255
  } else {
256
  DebugEcho("filter_AttachmentTemplates: skip attachment (alt) " . $attachment['filename']);
2150
  } else {
2151
  DebugEcho("filter_ReplaceImagePlaceHolders_worker: No caption found");
2152
  }
2153
+ DebugEcho("filter_ReplaceImagePlaceHolders_worker: parameterize templete: $imageTemplate");
2154
  $imageTemplate = mb_str_replace('{CAPTION}', htmlspecialchars($caption, ENT_QUOTES), $imageTemplate);
2155
+ DebugEcho("filter_ReplaceImagePlaceHolders_worker: captioned template: $imageTemplate");
2156
 
2157
  $img_placeholder_temp .= '#';
2158
 
2159
+ $imageTemplate = apply_filters('postie_place_media', $imageTemplate, $attachment['wp_id']);
2160
+ DebugEcho("filter_ReplaceImagePlaceHolders_worker: post filter: '$imageTemplate'");
2161
+
2162
  $content = str_ireplace($img_placeholder_temp, $imageTemplate, $content);
2163
  DebugEcho("filter_ReplaceImagePlaceHolders_worker: post replace: $content");
2164
  }
postie.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: Postie
5
  Plugin URI: http://PostiePlugin.com/
6
  Description: Create posts via email. Significantly upgrades the Post by Email features of WordPress.
7
- Version: 1.8.9
8
  Author: Wayne Allen
9
  Author URI: http://PostiePlugin.com/
10
  License: GPL2
@@ -28,7 +28,7 @@
28
  */
29
 
30
  /*
31
- $Id: postie.php 1520725 2016-10-24 03:11:10Z WayneAllen $
32
  */
33
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "lib/fException.php");
34
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "lib/fUnexpectedException.php");
@@ -49,7 +49,7 @@ require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "lib/pPop3MailServer.php"
49
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "lib_autolink.php");
50
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "postie-functions.php");
51
 
52
- define('POSTIE_VERSION', '1.8.9');
53
  define("POSTIE_ROOT", dirname(__FILE__));
54
  define("POSTIE_URL", WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
55
 
4
  Plugin Name: Postie
5
  Plugin URI: http://PostiePlugin.com/
6
  Description: Create posts via email. Significantly upgrades the Post by Email features of WordPress.
7
+ Version: 1.8.10
8
  Author: Wayne Allen
9
  Author URI: http://PostiePlugin.com/
10
  License: GPL2
28
  */
29
 
30
  /*
31
+ $Id: postie.php 1521269 2016-10-24 17:30:03Z WayneAllen $
32
  */
33
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "lib/fException.php");
34
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "lib/fUnexpectedException.php");
49
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "lib_autolink.php");
50
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "postie-functions.php");
51
 
52
+ define('POSTIE_VERSION', '1.8.10');
53
  define("POSTIE_ROOT", dirname(__FILE__));
54
  define("POSTIE_URL", WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
55
 
readme.txt CHANGED
@@ -6,7 +6,7 @@ Plugin URI: http://PostiePlugin.com/
6
  Tags: e-mail, email, post-by-email
7
  Requires at least: 3.3.0
8
  Tested up to: 4.6.1
9
- Stable tag: 1.8.9
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -240,7 +240,12 @@ All script, style and body tags are stripped from html emails.
240
  Attachments are now processed in the order they were attached.
241
 
242
  == CHANGELOG ==
243
- = 1.8.8 (2016-10-23) =
 
 
 
 
 
244
  * Fix bug when calling new postie_email_* filters
245
  * Fix bug where inline and related attachments were not being considered for #img#
246
 
@@ -1387,3 +1392,4 @@ plugin. And the rest is history :)
1387
  *
1388
  = 0.1 - 2004-06 =
1389
  * First release
 
6
  Tags: e-mail, email, post-by-email
7
  Requires at least: 3.3.0
8
  Tested up to: 4.6.1
9
+ Stable tag: 1.8.10
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
240
  Attachments are now processed in the order they were attached.
241
 
242
  == CHANGELOG ==
243
+ = 1.8.10 (2016-10-24) =
244
+ * New filter postie_place_media - allows markup to be changed when #img# references are being replaced.
245
+ * New filter postie_place_media_before - allows markup to be changed when attachment templates are placed before the content.
246
+ * New filter postie_place_media_after - allows markup to be changed when attachment templates are placed after the content.
247
+
248
+ = 1.8.9 (2016-10-23) =
249
  * Fix bug when calling new postie_email_* filters
250
  * Fix bug where inline and related attachments were not being considered for #img#
251
 
1392
  *
1393
  = 0.1 - 2004-06 =
1394
  * First release
1395
+