Skip to content
Prev Previous commit
Next Next commit
Rename WP_Block_Template to Gutenberg_Block_Template so that 5.8 rece…
…ives improvements to it
  • Loading branch information
talldan committed Dec 1, 2021
commit d210a6c5cc5004f0d5a680ac48fb22aee3caf1a2
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Blocks API: WP_Block_Template class
* Blocks API: Gutenberg_Block_Template class
*
* @package WordPress
* @since 5.5.0
Expand All @@ -9,7 +9,7 @@
/**
* Class representing a block template.
*/
class WP_Block_Template {
class Gutenberg_Block_Template {
Copy link
Contributor Author

@talldan talldan Dec 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've renamed this and the situation should be:

  • If Gutenberg is running on WordPress 5.8, Gutenberg_Block_Template is used instead of WP_Block_Template`, since the latter is outdated in 5.8.
  • If Gutenberg is running on WordPress 5.9, WP_Block_Template is used.

This should resolve any issues where author or origin might not be defined on 5.8.


/**
* Type: wp_template or wp_template_part
Expand Down