Pārlūkot izejas kodu

Blockbase: Change references to gutenberg_block_template_part, to block_template_part (#5031)

* Blockbase: Change references to gutenberg_block_template_part, to block_template_part

* use an if statement to determine which function to call
Ben Dwyer 3 gadi atpakaļ
vecāks
revīzija
2bd5b5ecc8
3 mainītis faili ar 15 papildinājumiem un 3 dzēšanām
  1. 5 1
      blockbase/footer.php
  2. 5 1
      blockbase/header.php
  3. 5 1
      blockbase/index.php

+ 5 - 1
blockbase/footer.php

@@ -1,6 +1,10 @@
 <footer class="wp-block-template-part site-footer-container">
 		<?php
-			echo gutenberg_block_template_part( 'footer' );
+			if ( function_exists( 'block_template_part' ) ) {
+				echo block_template_part( 'footer' );
+			} else {
+				echo gutenberg_block_template_part( 'footer' );
+			}
 		?>
 	</div>
 </footer>

+ 5 - 1
blockbase/header.php

@@ -13,6 +13,10 @@
 	<div class="wp-site-blocks">
 		<header class="wp-block-template-part">
 			<?php
-				echo gutenberg_block_template_part( 'header' );
+				if ( function_exists( 'block_template_part' ) ) {
+					echo block_template_part( 'header' );
+				} else {
+					echo gutenberg_block_template_part( 'header' );
+				}
 			?>
 		</header>

+ 5 - 1
blockbase/index.php

@@ -15,6 +15,10 @@
 get_header();
 
 // the query
-echo gutenberg_block_template_part( 'index' );
+if ( function_exists( 'block_template_part' ) ) {
+	echo block_template_part( 'index' );
+} else {
+	echo gutenberg_block_template_part( 'index' );
+}
 
 get_footer();