| @@ -59,13 +59,22 @@ | ||
| 59 | 59 | |
| 60 | 60 | /** |
| 61 | 61 | * Option names whose writes trigger a page-cache purge. |
| 62 | 62 | * |
| 63 | + * Defaults cover every option whose values reach the cached page's inline | |
| 64 | + * widget payload: mxchat_options (settings/behavior gates), | |
| 65 | + * mxchat_theme_options (active AI theme CSS + bot theme assignments — | |
| 66 | + * written only by the MxChat Theme add-on's admin AJAX actions), and | |
| 67 | + * mxchat_prompts_options (Pinecone toggle — written only by the prompts | |
| 68 | + * autosave). All write sites are admin-action-driven; the debounce | |
| 69 | + * absorbs back-to-back writes like apply-and-save. | |
| 70 | + * | |
| 63 | 71 | * @return string[] |
| 64 | 72 | */ |
| 65 | 73 | private function watched_options() { |
| 66 | - $options = apply_filters('mxchat_cache_purge_watched_options', array('mxchat_options')); | |
| 67 | - return is_array($options) ? array_filter(array_map('strval', $options)) : array('mxchat_options'); | |
| 74 | + $defaults = array('mxchat_options', 'mxchat_theme_options', 'mxchat_prompts_options'); | |
| 75 | + $options = apply_filters('mxchat_cache_purge_watched_options', $defaults); | |
| 76 | + return is_array($options) ? array_filter(array_map('strval', $options)) : $defaults; | |
| 68 | 77 | } |
| 69 | 78 | |
| 70 | 79 | /** |
| 71 | 80 | * Coalesce all option writes in this request into one shutdown purge. |