Auto-delete posts and messages after one year
It would be great to have an option to enable automatic deletion of posts and messages after a year. This could be useful for channel situations, or channels with projects of a temporary nature.
Shahjahan Jewel Is it possible to make deletion after a certain period of time or in delayed mode to make the post "archived" - which would mean, always at the bottom of the search list, does not go up in the feed view mode through the filter "activity". This would be useful for posts with low relevance after 1-7 days, conditionally the weather forecast for yesterday is not so relevant anymore.
It would be great to have temporary publications.
We don't have any plan to delete feeds automatically. But if you want to do it manually, here is the code snippet:
$oldFeeds = \FluentCommunity\App\Models\Feed::where('created_at', '>', gmdate('Y-m-d H:i:s', current_time('timestamp') - 365 * 24 * 60 * 60))
->where('id', $feed_id)
->limit(100)
->get();
foreach ($oldFeeds as $oldFeed) {
do_action('fluent_community/feed/before_deleted', $oldFeed);
$oldFeed->delete();
do_action('fluent_community/feed/deleted', $feed_id);
}
Shahjahan Jewel thanks!