Postie - Version 1.7.6

Version Description

(2015-08-13) = * Added setting to control whether the featured image is included in the post or not. * Added 2 new filters, postie_comment_before and postie_comment_after

Download this release

Release Info

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

Code changes from version 1.7.5 to 1.7.6

Files changed (6) hide show
  1. config_form.php +1 -0
  2. docs/Changes.txt +4 -0
  3. docs/Postie.txt +1 -1
  4. postie-functions.php +13 -8
  5. postie.php +3 -3
  6. readme.txt +5 -1
config_form.php CHANGED
@@ -474,6 +474,7 @@
474
 
475
  <?php
476
  echo BuildBooleanSelect(__("Use First Image as Featured Image", "postie"), "postie-settings[featured_image]", $featured_image, __("If any images are attached, the first one will be the featured image for the post", "postie"));
 
477
  echo BuildBooleanSelect(__("Automatically insert image gallery", "postie"), "postie-settings[auto_gallery]", $auto_gallery, __("If any images are attached, they will automatically be inserted as a gallery", "postie"));
478
  echo BuildSelect(__("Gallery Link Type", "postie"), "postie-settings[auto_gallery_link]", $auto_gallery_link, array('Default', 'Post', 'File', 'None'),"Select the type of link the gallery should use");
479
  echo BuildBooleanSelect(__("Image Location", "postie"), "postie-settings[images_append]", $images_append, __("Location of attachments if using 'plain' format. Before or After content.", "postie"), array('After', 'Before'));
474
 
475
  <?php
476
  echo BuildBooleanSelect(__("Use First Image as Featured Image", "postie"), "postie-settings[featured_image]", $featured_image, __("If any images are attached, the first one will be the featured image for the post", "postie"));
477
+ echo BuildBooleanSelect(__("Include Featured Image in Post", "postie"), "postie-settings[include_featured_image]", $include_featured_image, __("Should the featured image be included in the post", "postie"));
478
  echo BuildBooleanSelect(__("Automatically insert image gallery", "postie"), "postie-settings[auto_gallery]", $auto_gallery, __("If any images are attached, they will automatically be inserted as a gallery", "postie"));
479
  echo BuildSelect(__("Gallery Link Type", "postie"), "postie-settings[auto_gallery_link]", $auto_gallery_link, array('Default', 'Post', 'File', 'None'),"Select the type of link the gallery should use");
480
  echo BuildBooleanSelect(__("Image Location", "postie"), "postie-settings[images_append]", $images_append, __("Location of attachments if using 'plain' format. Before or After content.", "postie"), array('After', 'Before'));
docs/Changes.txt CHANGED
@@ -27,6 +27,10 @@ All script, style and body tags are stripped from html emails.
27
  Attachments are now processed in the order they were attached.
28
 
29
  == CHANGELOG ==
 
 
 
 
30
  = 1.7.5 (2015-08-06) =
31
  * If featured image is enabled, the featured image will no longer appear in the post.
32
 
27
  Attachments are now processed in the order they were attached.
28
 
29
  == CHANGELOG ==
30
+ = 1.7.6 (2015-08-13) =
31
+ * Added setting to control whether the featured image is included in the post or not.
32
+ * Added 2 new filters, postie_comment_before and postie_comment_after
33
+
34
  = 1.7.5 (2015-08-06) =
35
  * If featured image is enabled, the featured image will no longer appear in the post.
36
 
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.2.4
9
- Stable tag: 1.7.5
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.2.4
9
+ Stable tag: 1.7.6
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 1214334 2015-08-06 19:00:48Z WayneAllen $
4
  */
5
 
6
  //to turn on debug output add the following line to wp-config.php
@@ -930,8 +930,9 @@ function PostToDB($details, $isReply, $customImageField, $postmodifiers) {
930
  'comment_parent' => 0,
931
  'user_id' => $details['user_ID']
932
  );
933
-
934
- $post_ID = wp_insert_comment($comment);
 
935
  }
936
 
937
  if ($post_ID) {
@@ -1156,15 +1157,18 @@ function GetContent($part, &$attachments, $post_id, $poster, $config) {
1156
  DebugEcho("GetContent: image Attachement: $filename");
1157
  $file_id = postie_media_handle_upload($part, $post_id, $poster, $config['generate_thumbnails'], $mimetype_primary, $mimetype_secondary);
1158
  if (!is_wp_error($file_id)) {
1159
- //featured image logic
1160
  //set the first image we come across as the featured image
1161
- DebugEcho("GetContent: has_post_thumbnail: " . boolval(has_post_thumbnail($post_id)));
1162
- //DebugEcho("get_the_post_thumbnail: " .get_the_post_thumbnail($post_id));
1163
-
1164
  if ($config['featured_image'] && !has_post_thumbnail($post_id)) {
1165
  DebugEcho("GetContent: featured image: $file_id");
1166
  set_post_thumbnail($post_id, $file_id);
1167
- } else {
 
 
 
 
 
 
1168
  $cid = "";
1169
  if (array_key_exists('content-id', $part->headers)) {
1170
  $cid = trim($part->headers["content-id"], "<>");
@@ -3026,6 +3030,7 @@ function config_GetDefaults() {
3026
  'video2templates' => $video2Templates,
3027
  'wrap_pre' => 'no',
3028
  'featured_image' => false,
 
3029
  'email_tls' => false,
3030
  'post_format' => 'standard',
3031
  'post_type' => 'post',
1
  <?php
2
  /*
3
+ $Id: postie-functions.php 1220239 2015-08-13 19:39:22Z WayneAllen $
4
  */
5
 
6
  //to turn on debug output add the following line to wp-config.php
930
  'comment_parent' => 0,
931
  'user_id' => $details['user_ID']
932
  );
933
+ $comment = apply_filters('postie_comment_before', $comment);
934
+ $post_ID = wp_new_comment($comment);
935
+ do_action('postie_comment_after', $comment);
936
  }
937
 
938
  if ($post_ID) {
1157
  DebugEcho("GetContent: image Attachement: $filename");
1158
  $file_id = postie_media_handle_upload($part, $post_id, $poster, $config['generate_thumbnails'], $mimetype_primary, $mimetype_secondary);
1159
  if (!is_wp_error($file_id)) {
1160
+ $addimage = true;
1161
  //set the first image we come across as the featured image
 
 
 
1162
  if ($config['featured_image'] && !has_post_thumbnail($post_id)) {
1163
  DebugEcho("GetContent: featured image: $file_id");
1164
  set_post_thumbnail($post_id, $file_id);
1165
+
1166
+ //optionally skip adding the featured imagea to the post
1167
+ $addimage = $config['include_featured_image'];
1168
+ }
1169
+
1170
+ if ($addimage) {
1171
+ DebugEcho("GetContent: adding image: $file_id");
1172
  $cid = "";
1173
  if (array_key_exists('content-id', $part->headers)) {
1174
  $cid = trim($part->headers["content-id"], "<>");
3030
  'video2templates' => $video2Templates,
3031
  'wrap_pre' => 'no',
3032
  'featured_image' => false,
3033
+ 'include_featured_image' => true,
3034
  'email_tls' => false,
3035
  'post_format' => 'standard',
3036
  'post_type' => 'post',
postie.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: Postie
5
  Plugin URI: http://PostiePlugin.com/
6
  Description: Create posts via email. Signifigantly upgrades the Post by Email features of Word Press.
7
- Version: 1.7.5
8
  Author: Wayne Allen
9
  Author URI: http://PostiePlugin.com/
10
  License: GPL2
@@ -27,11 +27,11 @@
27
  */
28
 
29
  /*
30
- $Id: postie.php 1214334 2015-08-06 19:00:48Z WayneAllen $
31
  */
32
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "postie-functions.php");
33
 
34
- define('POSTIE_VERSION', '1.7.5');
35
  define("POSTIE_ROOT", dirname(__FILE__));
36
  define("POSTIE_URL", WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
37
 
4
  Plugin Name: Postie
5
  Plugin URI: http://PostiePlugin.com/
6
  Description: Create posts via email. Signifigantly upgrades the Post by Email features of Word Press.
7
+ Version: 1.7.6
8
  Author: Wayne Allen
9
  Author URI: http://PostiePlugin.com/
10
  License: GPL2
27
  */
28
 
29
  /*
30
+ $Id: postie.php 1220239 2015-08-13 19:39:22Z WayneAllen $
31
  */
32
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "postie-functions.php");
33
 
34
+ define('POSTIE_VERSION', '1.7.6');
35
  define("POSTIE_ROOT", dirname(__FILE__));
36
  define("POSTIE_URL", WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
37
 
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.2.4
9
- Stable tag: 1.7.5
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -234,6 +234,10 @@ All script, style and body tags are stripped from html emails.
234
  Attachments are now processed in the order they were attached.
235
 
236
  == CHANGELOG ==
 
 
 
 
237
  = 1.7.5 (2015-08-06) =
238
  * If featured image is enabled, the featured image will no longer appear in the post.
239
 
6
  Tags: e-mail, email, post-by-email
7
  Requires at least: 3.3.0
8
  Tested up to: 4.2.4
9
+ Stable tag: 1.7.6
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
234
  Attachments are now processed in the order they were attached.
235
 
236
  == CHANGELOG ==
237
+ = 1.7.6 (2015-08-13) =
238
+ * Added setting to control whether the featured image is included in the post or not.
239
+ * Added 2 new filters, postie_comment_before and postie_comment_after
240
+
241
  = 1.7.5 (2015-08-06) =
242
  * If featured image is enabled, the featured image will no longer appear in the post.
243