Post Expirator - Version 2.3.1

Version Description

Download this release

Release Info

Developer axelseaa
Plugin Icon 128x128 Post Expirator
Version 2.3.1
Comparing to
See all releases

Code changes from version 2.3.0 to 2.3.1

Files changed (2) hide show
  1. post-expirator.php +10 -7
  2. readme.txt +5 -1
post-expirator.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Post Expirator
4
  Plugin URI: http://wordpress.org/extend/plugins/post-expirator/
5
  Description: Allows you to add an expiration date (minute) to posts which you can configure to either delete the post, change it to a draft, or update the post categories at expiration time.
6
  Author: Aaron Axelsen
7
- Version: 2.3.0
8
  Author URI: http://postexpirator.tuxdocs.net/
9
  Text Domain: post-expirator
10
  */
@@ -17,7 +17,7 @@ function postExpirator_init() {
17
  add_action('plugins_loaded', 'postExpirator_init');
18
 
19
  // Default Values
20
- define('POSTEXPIRATOR_VERSION','2.3.0');
21
  define('POSTEXPIRATOR_DATEFORMAT',__('l F jS, Y','post-expirator'));
22
  define('POSTEXPIRATOR_TIMEFORMAT',__('g:ia','post-expirator'));
23
  define('POSTEXPIRATOR_FOOTERCONTENTS',__('Post expires at EXPIRATIONTIME on EXPIRATIONDATE','post-expirator'));
@@ -810,7 +810,7 @@ function postExpiratorExpire($id) {
810
 
811
  // Get Global Notification Emails
812
  $emaillist = get_option('expirationdateEmailNotificationList');
813
- if (isset($emaillist) && !empty(trim($emaillist))) {
814
  $vals = explode(',',$emaillist);
815
  foreach ($vals as $val) {
816
  $emails[] = trim($val);
@@ -819,7 +819,7 @@ function postExpiratorExpire($id) {
819
 
820
  // Get Post Type Notification Emails
821
  $defaults = get_option('expirationdateDefaults'.ucfirst($posttype));
822
- if (isset($defaults['emailnotification']) && !empty(trim($defaults['emailnotification']))) {
823
  $vals = explode(',',$defaults['emailnotification']);
824
  foreach ($vals as $val) {
825
  $emails[] = trim($val);
@@ -907,7 +907,7 @@ function postExpiratorMenuGeneral() {
907
  update_option('expirationdateDisplayFooter',$_POST['expired-display-footer']);
908
  update_option('expirationdateEmailNotification',$_POST['expired-email-notification']);
909
  update_option('expirationdateEmailNotificationAdmins',$_POST['expired-email-notification-admins']);
910
- update_option('expirationdateEmailNotificationList',$_POST['expired-email-notification-list']);
911
  update_option('expirationdateFooterContents',$_POST['expired-footer-contents']);
912
  update_option('expirationdateFooterStyle',$_POST['expired-footer-style']);
913
  if (isset($_POST['expirationdate_category'])) update_option('expirationdateCategoryDefaults',$_POST['expirationdate_category']);
@@ -1126,10 +1126,10 @@ function postExpiratorMenuDefaults() {
1126
  if (isset($_POST['expirationdate_activemeta-'.$type])) {
1127
  $defaults[$type]['activeMetaBox'] = $_POST['expirationdate_activemeta-'.$type];
1128
  }
1129
- $defaults[$type]['emailnotification'] = $_POST['expirationdate_emailnotification-'.$type];
1130
 
1131
  //Save Settings
1132
- update_option('expirationdateDefaults'.ucfirst($type),$defaults[$type]);
1133
  }
1134
  echo "<div id='message' class='updated fade'><p>";
1135
  _e('Saved Options!','post-expirator');
@@ -1531,6 +1531,9 @@ function postexpirator_upgrade() {
1531
  if (version_compare($version,'2.3.0') == -1) {
1532
  update_option('postexpiratorVersion',POSTEXPIRATOR_VERSION);
1533
  }
 
 
 
1534
  }
1535
  }
1536
  add_action('admin_init','postexpirator_upgrade');
4
  Plugin URI: http://wordpress.org/extend/plugins/post-expirator/
5
  Description: Allows you to add an expiration date (minute) to posts which you can configure to either delete the post, change it to a draft, or update the post categories at expiration time.
6
  Author: Aaron Axelsen
7
+ Version: 2.3.1
8
  Author URI: http://postexpirator.tuxdocs.net/
9
  Text Domain: post-expirator
10
  */
17
  add_action('plugins_loaded', 'postExpirator_init');
18
 
19
  // Default Values
20
+ define('POSTEXPIRATOR_VERSION','2.3.1');
21
  define('POSTEXPIRATOR_DATEFORMAT',__('l F jS, Y','post-expirator'));
22
  define('POSTEXPIRATOR_TIMEFORMAT',__('g:ia','post-expirator'));
23
  define('POSTEXPIRATOR_FOOTERCONTENTS',__('Post expires at EXPIRATIONTIME on EXPIRATIONDATE','post-expirator'));
810
 
811
  // Get Global Notification Emails
812
  $emaillist = get_option('expirationdateEmailNotificationList');
813
+ if (!empty($emaillist)) {
814
  $vals = explode(',',$emaillist);
815
  foreach ($vals as $val) {
816
  $emails[] = trim($val);
819
 
820
  // Get Post Type Notification Emails
821
  $defaults = get_option('expirationdateDefaults'.ucfirst($posttype));
822
+ if (isset($defaults['emailnotification']) && !empty($defaults['emailnotification'])) {
823
  $vals = explode(',',$defaults['emailnotification']);
824
  foreach ($vals as $val) {
825
  $emails[] = trim($val);
907
  update_option('expirationdateDisplayFooter',$_POST['expired-display-footer']);
908
  update_option('expirationdateEmailNotification',$_POST['expired-email-notification']);
909
  update_option('expirationdateEmailNotificationAdmins',$_POST['expired-email-notification-admins']);
910
+ update_option('expirationdateEmailNotificationList',trim($_POST['expired-email-notification-list']));
911
  update_option('expirationdateFooterContents',$_POST['expired-footer-contents']);
912
  update_option('expirationdateFooterStyle',$_POST['expired-footer-style']);
913
  if (isset($_POST['expirationdate_category'])) update_option('expirationdateCategoryDefaults',$_POST['expirationdate_category']);
1126
  if (isset($_POST['expirationdate_activemeta-'.$type])) {
1127
  $defaults[$type]['activeMetaBox'] = $_POST['expirationdate_activemeta-'.$type];
1128
  }
1129
+ $defaults[$type]['emailnotification'] = trim($_POST['expirationdate_emailnotification-'.$type]);
1130
 
1131
  //Save Settings
1132
+ update_option('expirationdateDefaults'.ucfirst($type),$defaults[$type]);
1133
  }
1134
  echo "<div id='message' class='updated fade'><p>";
1135
  _e('Saved Options!','post-expirator');
1531
  if (version_compare($version,'2.3.0') == -1) {
1532
  update_option('postexpiratorVersion',POSTEXPIRATOR_VERSION);
1533
  }
1534
+ if (version_compare($version,'2.3.1') == -1) {
1535
+ update_option('postexpiratorVersion',POSTEXPIRATOR_VERSION);
1536
+ }
1537
  }
1538
  }
1539
  add_action('admin_init','postexpirator_upgrade');
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://aaron.axelsen.us/donate
4
  Tags: expire, posts, pages, schedule
5
  Requires at least: 4.0
6
  Tested up to: 4.8
7
- Stable tag: 2.3.0
8
 
9
  Allows you to add an expiration date to posts which you can configure to either delete the post, change it to a draft, or update the
10
  post categories.
@@ -57,6 +57,10 @@ This section describes how to install the plugin and get it working.
57
 
58
  == Changelog ==
59
 
 
 
 
 
60
  **Version 2.3.0**
61
 
62
  * New: Email notification upon post expiration. A global email can be set, blog admins can be selected and/or specific users based on post type can be notified.
4
  Tags: expire, posts, pages, schedule
5
  Requires at least: 4.0
6
  Tested up to: 4.8
7
+ Stable tag: 2.3.1
8
 
9
  Allows you to add an expiration date to posts which you can configure to either delete the post, change it to a draft, or update the
10
  post categories.
57
 
58
  == Changelog ==
59
 
60
+ **Version 2.3.1**
61
+
62
+ * Fix: Fixed PHP Error that snuck in on some installations.
63
+
64
  **Version 2.3.0**
65
 
66
  * New: Email notification upon post expiration. A global email can be set, blog admins can be selected and/or specific users based on post type can be notified.