Permalink
Browse files

必要に応じてpub_dateを更新

OnDocUnPublished
unpub_dateは値の内容に関わらず更新しない
  • Loading branch information...
1 parent d4f793b commit 47a58ce5ce45666980d4b9d3efc6435d4fe1e6ea @yama yama committed Oct 12, 2015
Showing with 3 additions and 2 deletions.
  1. +3 −2 manager/processors/document/unpublish_content.processor.php
@@ -18,10 +18,11 @@
exit;
}
+$doc = $modx->db->getObject('site_content',"id='{$id}'");
+
// update the document
$field['published'] = 0;
-$field['pub_date'] = 0;
-$field['unpub_date'] = 0;
+if($doc->pub_date < time()) $field['pub_date'] = 0;
$field['publishedby'] = 0;
$field['publishedon'] = 0;

0 comments on commit 47a58ce

Please sign in to comment.