Gutenberg - Version 10.5.4

Version Description

Download this release

Release Info

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

Code changes from version 10.5.3 to 10.5.4

changelog.txt CHANGED
@@ -1,9 +1,18 @@
1
  == Changelog ==
2
 
3
- = 10.5.3 =
4
 
5
- ## Bug Fixes
 
 
 
6
 
 
 
 
 
 
 
7
  - Fix the stylesheet loading order for non FSE themes.
8
 
9
 
1
  == Changelog ==
2
 
3
+ = 10.5.4 =
4
 
5
+ ### Bug Fixes
6
+
7
+ - Fix for template order logic. ([31478](https://github.com/WordPress/gutenberg/pull/31478)) ([31336](https://github.com/WordPress/gutenberg/pull/31336))
8
+
9
 
10
+
11
+
12
+ = 10.5.3 =
13
+
14
+ ## Bug Fixes
15
+
16
  - Fix the stylesheet loading order for non FSE themes.
17
 
18
 
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.6
7
  * Requires PHP: 5.6
8
- * Version: 10.5.3
9
  * Author: Gutenberg Team
10
  * Text Domain: gutenberg
11
  *
@@ -13,8 +13,8 @@
13
  */
14
 
15
  ### BEGIN AUTO-GENERATED DEFINES
16
- define( 'GUTENBERG_VERSION', '10.5.3' );
17
- define( 'GUTENBERG_GIT_COMMIT', '4f6d84bfbb6a38e7f8f1c46e5bd2ba262813e3c0' );
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.6
7
  * Requires PHP: 5.6
8
+ * Version: 10.5.4
9
  * Author: Gutenberg Team
10
  * Text Domain: gutenberg
11
  *
13
  */
14
 
15
  ### BEGIN AUTO-GENERATED DEFINES
16
+ define( 'GUTENBERG_VERSION', '10.5.4' );
17
+ define( 'GUTENBERG_GIT_COMMIT', 'b786a9416b311fc550b22a50927b930a36568dca' );
18
  ### END AUTO-GENERATED DEFINES
19
 
20
  gutenberg_pre_init();
lib/full-site-editing/template-loader.php CHANGED
@@ -66,13 +66,34 @@ function gutenberg_override_query_template( $template, $type, array $templates =
66
  $current_template = gutenberg_resolve_template( $type, $templates );
67
 
68
  // Allow falling back to a PHP template if it has a higher priority than the block template.
69
- $current_template_slug = basename( $template, '.php' );
 
 
 
 
70
  $current_block_template_slug = is_object( $current_template ) ? $current_template->slug : false;
71
  foreach ( $templates as $template_item ) {
72
  $template_item_slug = gutenberg_strip_php_suffix( $template_item );
73
 
74
  // Break the loop if the block-template matches the template slug.
75
  if ( $current_block_template_slug === $template_item_slug ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  break;
77
  }
78
 
66
  $current_template = gutenberg_resolve_template( $type, $templates );
67
 
68
  // Allow falling back to a PHP template if it has a higher priority than the block template.
69
+ $current_template_slug = str_replace(
70
+ array( trailingslashit( get_stylesheet_directory() ), trailingslashit( get_template_directory() ), '.php' ),
71
+ '',
72
+ $template
73
+ );
74
  $current_block_template_slug = is_object( $current_template ) ? $current_template->slug : false;
75
  foreach ( $templates as $template_item ) {
76
  $template_item_slug = gutenberg_strip_php_suffix( $template_item );
77
 
78
  // Break the loop if the block-template matches the template slug.
79
  if ( $current_block_template_slug === $template_item_slug ) {
80
+
81
+ // if the theme is a child theme we want to check if a php template exists.
82
+ if ( is_child_theme() ) {
83
+
84
+ $has_php_template = file_exists( get_stylesheet_directory() . '/' . $current_template_slug . '.php' );
85
+ $block_template = _gutenberg_get_template_file( 'wp_template', $current_block_template_slug );
86
+ $has_block_template = false;
87
+
88
+ if ( null !== $block_template && wp_get_theme()->get_stylesheet() === $block_template['theme'] ) {
89
+ $has_block_template = true;
90
+ }
91
+ // and that a corresponding block template from the theme and not the parent doesn't exist.
92
+ if ( $has_php_template && ! $has_block_template ) {
93
+ return $template;
94
+ }
95
+ }
96
+
97
  break;
98
  }
99
 
readme.txt CHANGED
@@ -55,4 +55,4 @@ View <a href="https://developer.wordpress.org/block-editor/principles/versions-i
55
 
56
  == Changelog ==
57
 
58
- To read the changelog for Gutenberg 10.5.3, please navigate to the <a href="https://github.com/WordPress/gutenberg/releases/tag/v10.5.3">release page</a>.
55
 
56
  == Changelog ==
57
 
58
+ To read the changelog for Gutenberg 10.5.4, please navigate to the <a href="https://github.com/WordPress/gutenberg/releases/tag/v10.5.4">release page</a>.