Skip to content

Fix cache invalidation and button to flush the cache manually#34

Merged
petitphp merged 3 commits into
masterfrom
fix/svg-cache
May 19, 2026
Merged

Fix cache invalidation and button to flush the cache manually#34
petitphp merged 3 commits into
masterfrom
fix/svg-cache

Conversation

@petitphp
Copy link
Copy Markdown
Member

@petitphp petitphp commented May 16, 2025

The PR update fixes the cache invalidation issue when an attachment is added, edited or deleted.

It also adds a button in the admin bar to manually flush the cache.

Fix #26


Note

Low Risk
Low risk: changes are limited to transient cache invalidation and a nonce-protected admin-only cache flush action, with minimal impact outside admin workflows.

Overview
Fixes SVG icon cache staleness by invalidating the transient when SVG attachments are added/edited/deleted (replacing the previous attachment save hook).

Adds an admin-bar “Flush ACF SVG Icon cache” action that deletes the cached transient via a nonce-verified, manage_options-gated handler, and centralizes the cache key as ACF_SVG_ICON_CACHE_KEY (updating translations accordingly).

Reviewed by Cursor Bugbot for commit 8c4c24b. Bugbot is set up for automated code reviews on this repo. Configure here.

asadowski10
asadowski10 previously approved these changes Jul 7, 2025
@petitphp petitphp merged commit 69ef7ea into master May 19, 2026
1 of 2 checks passed
@petitphp petitphp deleted the fix/svg-cache branch May 19, 2026 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

transient deletion

2 participants