Commit 96406ab3 authored by Rolf Forst's avatar Rolf Forst
Browse files

Add flush cache (rrze-cache)

parent c66a2254
......@@ -2,7 +2,7 @@
/*
Plugin Name: RRZE Post Expiration
Plugin URI: https://gitlab.rrze.fau.de/rrze-webteam/rrze-post-expiration
Version: 1.2.1
Version: 1.3.0
Description: Verfallsdatum für Beiträge und Seiten.
Author: RRZE-Webteam
License: GPLv2 or later
......@@ -35,8 +35,8 @@ class RRZE_Post_Expiration {
const option_name = 'rrze_post_expiration';
const php_version = '5.4';
const wp_version = '4.5';
const php_version = '5.5';
const wp_version = '4.6';
protected static $cron_hook;
......@@ -527,9 +527,21 @@ class RRZE_Post_Expiration {
if (!empty($result)) {
foreach ($result as $row) {
self::flush_cache(get_permalink($row->post_id));
wp_update_post(array('ID' => $row->post_id, 'post_status' => 'draft'));
}
}
}
public static function flush_cache($url) {
if (empty($url)) {
return;
}
// rrze-cache plugin
if (has_action('rrzecache_flush_cache_url')) {
do_action('rrzecache_flush_cache_url', $url);
}
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment