Post Expirator - Version 2.2.2

Version Description

Download this release

Release Info

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

Code changes from version 2.2.1 to 2.2.2

Files changed (2) hide show
  1. post-expirator.php +22 -12
  2. readme.txt +5 -2
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.2.1
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.2.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'));
@@ -525,22 +525,29 @@ function expirationdate_update_post_meta($id) {
525
  }
526
  $category = isset($_POST['expirationdate_category']) ? $_POST['expirationdate_category'] : 0;
527
 
528
- $opts = array();
529
  $ts = get_gmt_from_date("$year-$month-$day $hour:$minute:0",'U');
530
 
531
- // Schedule/Update Expiration
532
- $opts['expireType'] = $_POST['expirationdate_expiretype'];
533
- $opts['id'] = $id;
 
 
 
 
 
 
 
 
534
 
535
- if ($opts['expireType'] == 'category' || $opts['expireType'] == 'category-add' || $opts['expireType'] == 'category-remove') {
536
- if (isset($category) && !empty($category)) {
537
- if (!empty($category)) {
538
- $opts['category'] = $category;
539
- $opts['categoryTaxonomy'] = $_POST['taxonomy-heirarchical'];
 
540
  }
541
  }
542
  }
543
-
544
  _scheduleExpiratorEvent($id,$ts,$opts);
545
  } else {
546
  _unscheduleExpiratorEvent($id);
@@ -1359,6 +1366,9 @@ function postexpirator_upgrade() {
1359
  if (version_compare($version,'2.2.1') == -1) {
1360
  update_option('postexpiratorVersion',POSTEXPIRATOR_VERSION);
1361
  }
 
 
 
1362
  }
1363
  }
1364
  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.2.2
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.2.2');
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'));
525
  }
526
  $category = isset($_POST['expirationdate_category']) ? $_POST['expirationdate_category'] : 0;
527
 
 
528
  $ts = get_gmt_from_date("$year-$month-$day $hour:$minute:0",'U');
529
 
530
+ if (isset($_POST['expirationdate_quickedit'])) {
531
+ $ed = get_post_meta($id,'_expiration-date',true);
532
+ if ($ed) {
533
+ $opts = get_post_meta($id, '_expiration-date-options', true);
534
+ }
535
+ } else {
536
+ $opts = array();
537
+
538
+ // Schedule/Update Expiration
539
+ $opts['expireType'] = $_POST['expirationdate_expiretype'];
540
+ $opts['id'] = $id;
541
 
542
+ if ($opts['expireType'] == 'category' || $opts['expireType'] == 'category-add' || $opts['expireType'] == 'category-remove') {
543
+ if (isset($category) && !empty($category)) {
544
+ if (!empty($category)) {
545
+ $opts['category'] = $category;
546
+ $opts['categoryTaxonomy'] = $_POST['taxonomy-heirarchical'];
547
+ }
548
  }
549
  }
550
  }
 
551
  _scheduleExpiratorEvent($id,$ts,$opts);
552
  } else {
553
  _unscheduleExpiratorEvent($id);
1366
  if (version_compare($version,'2.2.1') == -1) {
1367
  update_option('postexpiratorVersion',POSTEXPIRATOR_VERSION);
1368
  }
1369
+ if (version_compare($version,'2.2.2') == -1) {
1370
+ update_option('postexpiratorVersion',POSTEXPIRATOR_VERSION);
1371
+ }
1372
  }
1373
  }
1374
  add_action('admin_init','postexpirator_upgrade');
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: axelseaa
3
  Donate link: http://aaron.axelsen.us/donate
4
  Tags: expire, posts, pages, schedule
5
  Requires at least: 4.0
6
- Tested up to: 4.7
7
- Stable tag: 2.2.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.
@@ -48,6 +48,9 @@ This section describes how to install the plugin and get it working.
48
 
49
  == Changelog ==
50
 
 
 
 
51
  **Version 2.2.1**
52
 
53
  * Fix: Fixed issue with bulk edit not correctly updating the expiration date.
3
  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.2.2
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.
48
 
49
  == Changelog ==
50
 
51
+ **Version 2.2.2**
52
+ * Fix: Quick Edit did not retain the expire type setting, and defaulted back to "Draft". This has been resolved.
53
+
54
  **Version 2.2.1**
55
 
56
  * Fix: Fixed issue with bulk edit not correctly updating the expiration date.