Version Description
Fixed bug with sql expiration query (props to Robert & John)
Download this release
Release Info
Developer | axelseaa |
Plugin | Post Expirator |
Version | 1.5.3 |
Comparing to | |
See all releases |
Code changes from version 1.5.2 to 1.5.3
- languages/post-expirator.pot +3 -3
- post-expirator.php +5 -5
- readme.txt +14 -1
- screenshot-1.png +0 -0
- screenshot-2.png +0 -0
- screenshot-3.png +0 -0
languages/post-expirator.pot
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
# This file is distributed under the same license as the Post Expirator package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Post Expirator 1.5.
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/post-expirator\n"
|
7 |
-
"POT-Creation-Date: 2012-
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
@@ -44,7 +44,7 @@ msgstr ""
|
|
44 |
msgid "Never"
|
45 |
msgstr ""
|
46 |
|
47 |
-
#. #-#-#-#-# plugin.pot (Post Expirator 1.5.
|
48 |
#. Plugin Name of the plugin/theme
|
49 |
#: post-expirator.php:184 post-expirator.php:186 post-expirator.php:439
|
50 |
msgid "Post Expirator"
|
2 |
# This file is distributed under the same license as the Post Expirator package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Post Expirator 1.5.3\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/post-expirator\n"
|
7 |
+
"POT-Creation-Date: 2012-04-23 00:12:47+00:00\n"
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
44 |
msgid "Never"
|
45 |
msgstr ""
|
46 |
|
47 |
+
#. #-#-#-#-# plugin.pot (Post Expirator 1.5.3) #-#-#-#-#
|
48 |
#. Plugin Name of the plugin/theme
|
49 |
#: post-expirator.php:184 post-expirator.php:186 post-expirator.php:439
|
50 |
msgid "Post Expirator"
|
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: 1.5.
|
8 |
Author URI: http://postexpirator.tuxdocs.net/
|
9 |
Translation: Thierry (http://palijn.info)
|
10 |
Text Domain: post-expirator
|
@@ -71,7 +71,7 @@ function expirationdate_delete_expired_posts() {
|
|
71 |
$result = $wpdb->get_results('select post_id, meta_value from ' . $wpdb->postmeta . ' as postmeta, '.$wpdb->posts.' as posts where postmeta.post_id = posts.ID AND posts.post_status = "publish" AND postmeta.meta_key = "expiration-date" AND postmeta.meta_value <= "' . $time_delete . '"');
|
72 |
if (!empty($result)) foreach ($result as $a) {
|
73 |
// Check to see if already proccessed
|
74 |
-
$processed = $wpdb->get_var('select meta_value from ' . $wpdb->postmeta . ' as postmeta, '.$wpdb->posts.' as posts where postmeta.post_id = posts.ID AND posts.ID = '.$a->post_id.' postmeta.meta_key = "_expiration-date-processed"');
|
75 |
if (!empty($processed) && $processed == 1) continue;
|
76 |
|
77 |
$post_result = $wpdb->get_var('select post_type from ' . $wpdb->posts .' where ID = '. $a->post_id);
|
@@ -94,7 +94,7 @@ function expirationdate_delete_expired_posts() {
|
|
94 |
else {
|
95 |
wp_update_post(array('ID' => $a->post_id, 'post_status' => 'draft'));
|
96 |
delete_post_meta($a->post_id, 'expiration-date');
|
97 |
-
update_post_meta($a->post_id, 'expiration-date', $a->meta_value
|
98 |
}
|
99 |
}
|
100 |
|
@@ -389,13 +389,13 @@ function expirationdate_update_post_meta($id) {
|
|
389 |
// Update Post Meta
|
390 |
delete_post_meta($id, '_expiration-date-category');
|
391 |
delete_post_meta($id, 'expiration-date');
|
392 |
-
update_post_meta($id, 'expiration-date', $ts
|
393 |
|
394 |
$catEnabled = get_option('expirationdateCategory');
|
395 |
if ((isset($category) && !empty($category)) && ($catEnabled === false || $catEnabled == 1)) {
|
396 |
if (!empty($category)) update_post_meta($id, '_expiration-date-category', $category);
|
397 |
}
|
398 |
-
update_post_meta($id, '_expiration-date-processed', 0
|
399 |
} else {
|
400 |
delete_post_meta($id, 'expiration-date');
|
401 |
delete_post_meta($id, '_expiration-date-category');
|
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: 1.5.3
|
8 |
Author URI: http://postexpirator.tuxdocs.net/
|
9 |
Translation: Thierry (http://palijn.info)
|
10 |
Text Domain: post-expirator
|
71 |
$result = $wpdb->get_results('select post_id, meta_value from ' . $wpdb->postmeta . ' as postmeta, '.$wpdb->posts.' as posts where postmeta.post_id = posts.ID AND posts.post_status = "publish" AND postmeta.meta_key = "expiration-date" AND postmeta.meta_value <= "' . $time_delete . '"');
|
72 |
if (!empty($result)) foreach ($result as $a) {
|
73 |
// Check to see if already proccessed
|
74 |
+
$processed = $wpdb->get_var('select meta_value from ' . $wpdb->postmeta . ' as postmeta, '.$wpdb->posts.' as posts where postmeta.post_id = posts.ID AND posts.ID = '.$a->post_id.' AND postmeta.meta_key = "_expiration-date-processed"');
|
75 |
if (!empty($processed) && $processed == 1) continue;
|
76 |
|
77 |
$post_result = $wpdb->get_var('select post_type from ' . $wpdb->posts .' where ID = '. $a->post_id);
|
94 |
else {
|
95 |
wp_update_post(array('ID' => $a->post_id, 'post_status' => 'draft'));
|
96 |
delete_post_meta($a->post_id, 'expiration-date');
|
97 |
+
update_post_meta($a->post_id, 'expiration-date', $a->meta_value);
|
98 |
}
|
99 |
}
|
100 |
|
389 |
// Update Post Meta
|
390 |
delete_post_meta($id, '_expiration-date-category');
|
391 |
delete_post_meta($id, 'expiration-date');
|
392 |
+
update_post_meta($id, 'expiration-date', $ts);
|
393 |
|
394 |
$catEnabled = get_option('expirationdateCategory');
|
395 |
if ((isset($category) && !empty($category)) && ($catEnabled === false || $catEnabled == 1)) {
|
396 |
if (!empty($category)) update_post_meta($id, '_expiration-date-category', $category);
|
397 |
}
|
398 |
+
update_post_meta($id, '_expiration-date-processed', 0);
|
399 |
} else {
|
400 |
delete_post_meta($id, 'expiration-date');
|
401 |
delete_post_meta($id, '_expiration-date-category');
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: axelseaa
|
|
3 |
Tags: expire, posts, pages, schedule
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 3.3.1
|
6 |
-
Stable tag: 1.5.
|
7 |
|
8 |
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
|
9 |
post categories.
|
@@ -37,8 +37,18 @@ This section describes how to install the plugin and get it working.
|
|
37 |
1. Unzip the plugin contents to the `/wp-content/plugins/post-expirator/` directory
|
38 |
2. Activate the plugin through the 'Plugins' menu in WordPress
|
39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
== Changelog ==
|
41 |
|
|
|
|
|
|
|
|
|
42 |
**Version 1.5.2**
|
43 |
|
44 |
* Fixed bug with shortcode that was displaying the expiration date in the incorrect timezone
|
@@ -109,5 +119,8 @@ NOTE: After upgrading, you may need to reset the cron schedules. Following onsc
|
|
109 |
|
110 |
== Upgrade Notice ==
|
111 |
|
|
|
|
|
|
|
112 |
= 1.5.2 =
|
113 |
Fixed shortcode timezone issue
|
3 |
Tags: expire, posts, pages, schedule
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 3.3.1
|
6 |
+
Stable tag: 1.5.3
|
7 |
|
8 |
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
|
9 |
post categories.
|
37 |
1. Unzip the plugin contents to the `/wp-content/plugins/post-expirator/` directory
|
38 |
2. Activate the plugin through the 'Plugins' menu in WordPress
|
39 |
|
40 |
+
== Screenshots ==
|
41 |
+
|
42 |
+
1. Adding expiration date to a post
|
43 |
+
2. Viewing the exipiration dates on the post overview screen
|
44 |
+
3. Settings screen
|
45 |
+
|
46 |
== Changelog ==
|
47 |
|
48 |
+
**Version 1.5.3**
|
49 |
+
|
50 |
+
* Fixed bug with sql expiration query (props to Robert & John)
|
51 |
+
|
52 |
**Version 1.5.2**
|
53 |
|
54 |
* Fixed bug with shortcode that was displaying the expiration date in the incorrect timezone
|
119 |
|
120 |
== Upgrade Notice ==
|
121 |
|
122 |
+
= 1.5.3 =
|
123 |
+
Fixed bug with sql expiration query (props to Robert & John)
|
124 |
+
|
125 |
= 1.5.2 =
|
126 |
Fixed shortcode timezone issue
|
screenshot-1.png
ADDED
Binary file
|
screenshot-2.png
ADDED
Binary file
|
screenshot-3.png
ADDED
Binary file
|