touch cache signal in block regeneration

This commit is contained in:
Andrey Kuvshinov
2025-08-27 16:59:29 +03:00
parent f3314894aa
commit 6cecde5d13

View File

@@ -86,6 +86,10 @@ function clear_post_cache_based_on_conditions( $post_id, $post ) {
clear_template_cache('template-parts/home/colon-item');
}
// Обновляем сигнальный файл
$fpc_signal = WP_CONTENT_DIR . '/uploads/fpcache/.last_modified';
touch($fpc_signal);
}
// Хук для обычного сохранения
@@ -104,9 +108,4 @@ add_action('transition_post_status', function($new_status, $old_status, $post) {
if (!current_user_can('edit_post', $post->ID)) return; // Используем $post->ID
clear_post_cache_based_on_conditions($post->ID, $post); // Передаем только $post
}, 10, 3);
?>
}, 10, 3);