Gutenberg - Version 14.5.3

Version Description

Download this release

Release Info

Developer gutenbergplugin
Plugin Icon 128x128 Gutenberg
Version 14.5.3
Comparing to
See all releases

Code changes from version 14.5.2 to 14.5.3

changelog.txt CHANGED
@@ -1,20 +1,45 @@
1
  == Changelog ==
2
 
3
- = 14.5.2 =
4
 
5
 
6
 
7
  ## Changelog
8
 
9
- ### Bug Fixes
 
 
 
 
 
 
 
 
 
10
 
11
- - Tag Processor: Prevent bugs from pre-PHP8 strspn/strcspn behavior. ([45822](https://github.com/WordPress/gutenberg/pull/45822))
12
 
13
  ## Contributors
14
 
15
  The following contributors merged PRs in this release:
16
 
17
- @dmsnell
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
 
19
 
20
  = 14.6.0-rc.1 =
1
  == Changelog ==
2
 
3
+ = 14.5.3 =
4
 
5
 
6
 
7
  ## Changelog
8
 
9
+ ### Performance
10
+
11
+ #### Global Styles
12
+ - Update `wp_theme_has_theme_json` to use `WP_Object_Cache`. ([45543](https://github.com/WordPress/gutenberg/pull/45543))
13
+
14
+
15
+ ## First time contributors
16
+
17
+ The following PRs were merged by first time contributors:
18
+
19
 
 
20
 
21
  ## Contributors
22
 
23
  The following contributors merged PRs in this release:
24
 
25
+ @oandregal
26
+
27
+
28
+ = 14.5.2 =
29
+
30
+
31
+
32
+ ## Changelog
33
+
34
+ ### Bug Fixes
35
+
36
+ - Tag Processor: Prevent bugs from pre-PHP8 strspn/strcspn behavior. ([45822](https://github.com/WordPress/gutenberg/pull/45822))
37
+
38
+ ## Contributors
39
+
40
+ The following contributors merged PRs in this release:
41
+
42
+ @dmsnell
43
 
44
 
45
  = 14.6.0-rc.1 =
gutenberg.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: Printing since 1440. This is the development plugin for the new block editor in core.
6
  * Requires at least: 5.9
7
  * Requires PHP: 5.6
8
- * Version: 14.5.2
9
  * Author: Gutenberg Team
10
  * Text Domain: gutenberg
11
  *
@@ -13,8 +13,8 @@
13
  */
14
 
15
  ### BEGIN AUTO-GENERATED DEFINES
16
- define( 'GUTENBERG_VERSION', '14.5.2' );
17
- define( 'GUTENBERG_GIT_COMMIT', 'ecb339bdcda0474adfcbad07dca714f925838bde' );
18
  ### END AUTO-GENERATED DEFINES
19
 
20
  gutenberg_pre_init();
5
  * Description: Printing since 1440. This is the development plugin for the new block editor in core.
6
  * Requires at least: 5.9
7
  * Requires PHP: 5.6
8
+ * Version: 14.5.3
9
  * Author: Gutenberg Team
10
  * Text Domain: gutenberg
11
  *
13
  */
14
 
15
  ### BEGIN AUTO-GENERATED DEFINES
16
+ define( 'GUTENBERG_VERSION', '14.5.3' );
17
+ define( 'GUTENBERG_GIT_COMMIT', '12904996c2c8d44e218daec683a3ba507e1a8546' );
18
  ### END AUTO-GENERATED DEFINES
19
 
20
  gutenberg_pre_init();
lib/compat/wordpress-6.2/default-filters.php CHANGED
@@ -17,11 +17,6 @@
17
  * @package gutenberg
18
  */
19
 
20
- /**
21
- * Note for backport: we should also remove the existing filters:
22
- *
23
- * > add_action( 'switch_theme', array( 'WP_Theme_JSON_Resolver', 'clean_cached_data' ) );
24
- * > add_action( 'start_previewing_theme', array( 'WP_Theme_JSON_Resolver', 'clean_cached_data' ) );
25
- */
26
- add_action( 'switch_theme', 'wp_theme_clean_theme_json_cached_data' );
27
- add_action( 'start_previewing_theme', 'wp_theme_clean_theme_json_cached_data' );
17
  * @package gutenberg
18
  */
19
 
20
+ add_action( 'switch_theme', 'wp_theme_has_theme_json_clean_cache' );
21
+ add_action( 'start_previewing_theme', 'wp_theme_has_theme_json_clean_cache' );
22
+ add_action( 'upgrader_process_complete', '_wp_theme_has_theme_json_clean_cache_upon_upgrading_active_theme' );
 
 
 
 
 
lib/compat/wordpress-6.2/get-global-styles-and-settings.php CHANGED
@@ -9,39 +9,69 @@ if ( ! function_exists( 'wp_theme_has_theme_json' ) ) {
9
  /**
10
  * Whether a theme or its parent have a theme.json file.
11
  *
12
- * @param boolean $clear_cache Whether the cache should be cleared and theme support recomputed. Default is false.
 
13
  *
14
  * @return boolean
15
  */
16
- function wp_theme_has_theme_json( $clear_cache = false ) {
17
- static $theme_has_support = null;
 
 
18
 
19
- if ( true === $clear_cache ) {
20
- $theme_has_support = null;
21
- }
22
-
23
- if ( null !== $theme_has_support ) {
24
- return $theme_has_support;
 
 
 
25
  }
26
 
27
  // Has the own theme a theme.json?
28
- $theme_has_support = is_readable( get_stylesheet_directory() . '/theme.json' );
29
 
30
  // Look up the parent if the child does not have a theme.json.
31
- if ( ! $theme_has_support ) {
32
- $theme_has_support = is_readable( get_template_directory() . '/theme.json' );
33
  }
34
 
35
- return $theme_has_support;
 
 
 
 
 
 
 
 
 
 
 
36
  }
37
  }
38
 
39
- if ( ! function_exists( 'wp_theme_clean_theme_json_cached_data' ) ) {
40
  /**
41
- * Clean theme.json related cached data.
 
 
 
 
 
 
 
42
  */
43
- function wp_theme_clean_theme_json_cached_data() {
44
- wp_theme_has_theme_json( true );
45
- WP_Theme_JSON_Resolver_Gutenberg::clean_cached_data();
 
 
 
 
 
 
46
  }
47
  }
9
  /**
10
  * Whether a theme or its parent have a theme.json file.
11
  *
12
+ * The result would be cached via the WP_Object_Cache.
13
+ * It can be cleared by calling wp_theme_has_theme_json_clean_cache().
14
  *
15
  * @return boolean
16
  */
17
+ function wp_theme_has_theme_json() {
18
+ $cache_group = 'theme_json';
19
+ $cache_key = 'wp_theme_has_theme_json';
20
+ $theme_has_support = wp_cache_get( $cache_key, $cache_group );
21
 
22
+ /**
23
+ * $theme_has_support is stored as a int in the cache.
24
+ *
25
+ * The reason not to store it as a boolean is to avoid working
26
+ * with the $found parameter which apparently had some issues in some implementations
27
+ * https://developer.wordpress.org/reference/functions/wp_cache_get/
28
+ */
29
+ if ( 0 === $theme_has_support || 1 === $theme_has_support ) {
30
+ return (bool) $theme_has_support;
31
  }
32
 
33
  // Has the own theme a theme.json?
34
+ $theme_has_support = is_readable( get_stylesheet_directory() . '/theme.json' ) ? 1 : 0;
35
 
36
  // Look up the parent if the child does not have a theme.json.
37
+ if ( 0 === $theme_has_support ) {
38
+ $theme_has_support = is_readable( get_template_directory() . '/theme.json' ) ? 1 : 0;
39
  }
40
 
41
+ wp_cache_set( $cache_key, $theme_has_support, $cache_group );
42
+
43
+ return (bool) $theme_has_support;
44
+ }
45
+ }
46
+
47
+ if ( ! function_exists( 'wp_theme_has_theme_json_clean_cache' ) ) {
48
+ /**
49
+ * Function to clean the cache used by wp_theme_has_theme_json method.
50
+ */
51
+ function wp_theme_has_theme_json_clean_cache() {
52
+ wp_cache_delete( 'wp_theme_has_theme_json', 'theme_json' );
53
  }
54
  }
55
 
56
+ if ( ! function_exists( '_wp_theme_has_theme_json_clean_cache_upon_upgrading_active_theme' ) ) {
57
  /**
58
+ * Private function to clean the cache used by wp_theme_has_theme_json method.
59
+ *
60
+ * It is hooked into the `upgrader_process_complete` action.
61
+ *
62
+ * @see default-filters.php
63
+ *
64
+ * @param WP_Upgrader $upgrader Instance of WP_Upgrader class.
65
+ * @param array $options Metadata that identifies the data that is updated.
66
  */
67
+ function _wp_theme_has_theme_json_clean_cache_upon_upgrading_active_theme( $upgrader, $options ) {
68
+ // The cache only needs cleaning when the active theme was updated.
69
+ if (
70
+ 'update' === $options['action'] &&
71
+ 'theme' === $options['type'] &&
72
+ ( isset( $options['themes'][ get_stylesheet() ] ) || isset( $options['themes'][ get_template() ] ) )
73
+ ) {
74
+ wp_theme_has_theme_json_clean_cache();
75
+ }
76
  }
77
  }
readme.txt CHANGED
@@ -1,7 +1,7 @@
1
  === Gutenberg ===
2
  Contributors: matveb, joen, karmatosed
3
  Tested up to: 6.0
4
- Stable tag: 14.5.1
5
  License: GPLv2 or later
6
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
 
1
  === Gutenberg ===
2
  Contributors: matveb, joen, karmatosed
3
  Tested up to: 6.0
4
+ Stable tag: 14.5.2
5
  License: GPLv2 or later
6
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
7