1111use Code_Snippets \Welcome_API ;
1212use function Code_Snippets \clean_snippets_cache ;
1313use function Code_Snippets \code_snippets ;
14+ use const Code_Snippets \CACHE_GROUP ;
1415
1516const CACHE_KEY = 'code_snippets_settings ' ;
1617const OPTION_GROUP = 'code-snippets ' ;
@@ -79,7 +80,7 @@ function are_settings_unified(): bool {
7980 * @return array<string, array<string, mixed>>
8081 */
8182function get_settings_values (): array {
82- $ settings = wp_cache_get ( CACHE_KEY );
83+ $ settings = wp_cache_get ( CACHE_KEY , CACHE_GROUP );
8384 if ( $ settings ) {
8485 return $ settings ;
8586 }
@@ -93,7 +94,7 @@ function get_settings_values(): array {
9394 }
9495 }
9596
96- wp_cache_set ( CACHE_KEY , $ settings );
97+ wp_cache_set ( CACHE_KEY , $ settings, CACHE_GROUP );
9798 return $ settings ;
9899}
99100
@@ -125,7 +126,7 @@ function update_setting( string $section, string $field, $new_value ): bool {
125126
126127 $ settings [ $ section ][ $ field ] = $ new_value ;
127128
128- wp_cache_set ( CACHE_KEY , $ settings );
129+ wp_cache_set ( CACHE_KEY , $ settings, CACHE_GROUP );
129130 return update_self_option ( are_settings_unified (), OPTION_NAME , $ settings );
130131}
131132
@@ -306,7 +307,7 @@ function process_settings_actions( array $input ): ?array {
306307 * @return array<string, array<string, mixed>> The validated settings.
307308 */
308309function sanitize_settings ( array $ input ): array {
309- wp_cache_delete ( CACHE_KEY );
310+ wp_cache_delete ( CACHE_KEY , CACHE_GROUP );
310311 $ result = process_settings_actions ( $ input );
311312
312313 if ( ! is_null ( $ result ) ) {
0 commit comments