Changeset 2045313
- Timestamp:
- 03/06/2019 02:34:42 PM (7 years ago)
- Location:
- wp-post-expires/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (2 diffs)
-
wp-post-expires.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-post-expires/trunk/readme.txt
r2045296 r2045313 5 5 Requires at least: 5.0 6 6 Tested up to: 5.1 7 Stable tag: 1.2 7 Stable tag: 1.2.1 8 8 License: GPLv2 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 42 42 == Changelog == 43 43 44 = 1.2.1 = 45 46 Small fixes: 47 https://wordpress.org/support/topic/fatal-error-3074/ ( tnx @marknopfler ) 48 https://wordpress.org/support/topic/fix-js-and-php-error/ ( tnx @lastant ) 49 50 44 51 = 1.2 = 45 52 -
wp-post-expires/trunk/wp-post-expires.php
r2045296 r2045313 3 3 Plugin Name: WP Post Expires 4 4 Description: A simple plugin allow to set the posts, the time after which will be performed one of 3 actions: "Add prefix to title", "Move to drafts", "Move to trash". 5 Version: 1.2 5 Version: 1.2.1 6 6 Author: XNicON 7 7 Author URI: https://xnicon.ru … … 28 28 29 29 class XNPostExpires { 30 private $plugin_version = '1.2 ';30 private $plugin_version = '1.2.1'; 31 31 private $url_assets; 32 32 public $settings = []; … … 247 247 $del_post = wp_trash_post($post_id); 248 248 //check post to trash, or deleted 249 if($del_post ['post_status'] == 'trash') {249 if($del_post !== false) { 250 250 update_post_meta($post_id, 'xn-wppe-expiration-action', 'add_prefix'); 251 251 update_post_meta($post_id, 'xn-wppe-expiration-prefix', $this->settings['prefix']); … … 271 271 $current = new DateTime(); 272 272 $current->setTimestamp(current_time('timestamp')); 273 $expiration = new DateTime($expires);274 275 if($ current >= $expiration) {273 $expiration = DateTime::createFromFormat('Y-m-d H:i', $expires); 274 275 if($expiration && $expiration->format('Y-m-d H:i') == $expires && $current >= $expiration) { 276 276 return true; 277 277 }
Note: See TracChangeset
for help on using the changeset viewer.