From e9967fa22781d922ba4eb8fb44fe72d200ac4b14 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Mon, 10 Nov 2025 21:04:10 +0000
Subject: [PATCH] =IconsManager.php update
---
inc/managers/NotificationManager.php | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/inc/managers/NotificationManager.php b/inc/managers/NotificationManager.php
index 146d2a0..db4a598 100644
--- a/inc/managers/NotificationManager.php
+++ b/inc/managers/NotificationManager.php
@@ -139,7 +139,7 @@
*/
public function __construct()
{
- $this->cache = new CacheManager('notifications', WEEK_IN_SECONDS); // 1 week cache
+ $this->cache = CacheManager::for('notifications', WEEK_IN_SECONDS);
// Add filter for bulk operation handling
add_filter(BASE . 'handle_bulk_operation', [ $this, 'processOperation' ], 10, 3);
@@ -435,6 +435,10 @@
*/
public function trackContentCreation(int $post_id, WP_POST $post, bool $update):void
{
+ // SAFETY: Skip attachments and other non-content post types
+ if (in_array($post->post_type, jvbIgnoredPostTypes())) {
+ return;
+ }
// Skip if not a published post
if ($post->post_status !== 'publish') {
return;
@@ -1095,7 +1099,7 @@
}
$content = '';
- $cache = new CacheManager('digest_content', HOUR_IN_SECONDS * 6); // Cache for 6 hours
+ $cache = CacheManager::for('digest_content', HOUR_IN_SECONDS * 6); // Cache for 6 hours
// Group updates by artist
$updates_by_artist = [];
@@ -1630,8 +1634,9 @@
*/
protected function clearNotificationCache(int $user_id):void
{
- $this->cache->invalidate("user_{$user_id}_notifications_", 'notifications_' . $user_id);
- $this->cache->invalidate("user_{$user_id}_content_notifications_", 'notifications_' . $user_id);
+
+ $this->cache->delete("user_{$user_id}_notifications_", 'notifications_' . $user_id);
+ $this->cache->delete("user_{$user_id}_content_notifications_", 'notifications_' . $user_id);
}
/**
--
Gitblit v1.10.0