Forráskód Böngészése

Blockbase: Clear cache when changing global styles from the Customizer (#4181)

* Clear the global styles cache when changing the customizer settings

* Clear the global styles cache when changing the customizer settings

* delete file from merge conflict
Ben Dwyer 4 éve
szülő
commit
c1377632a4

+ 2 - 1
blockbase/inc/customizer/wp-customize-colors.php

@@ -146,7 +146,8 @@ class GlobalStylesColorCustomizer {
 
 		// Update the theme.json with the new settings.
 		$user_theme_json_post->post_content = json_encode( $user_theme_json_post_content );
-		return wp_update_post( $user_theme_json_post );
+		wp_update_post( $user_theme_json_post );
+		delete_transient( 'global_styles' );
 	}
 
 	function check_if_colors_are_default() {

+ 2 - 1
blockbase/inc/customizer/wp-customize-fonts.php

@@ -430,7 +430,8 @@ class GlobalStylesFontsCustomizer {
 
 		// Update the theme.json with the new settings.
 		$user_theme_json_post->post_content = json_encode( $user_theme_json_post_content );
-		return wp_update_post( $user_theme_json_post );
+		wp_update_post( $user_theme_json_post );
+		delete_transient( 'global_styles' );
 	}
 
 }