Skip to content

Commit

Permalink
Rename block-templates and block-template-part folders for WordPress …
Browse files Browse the repository at this point in the history
…5.9 #10
  • Loading branch information
bobbingwide committed Jan 24, 2022
1 parent 020d2ac commit 4f70d4e
Show file tree
Hide file tree
Showing 15 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions includes/template-part.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ function wizzie_render_block_core_template_part( $attributes, $content, $block
// Else, if the template part was provided by the active theme,
// render the corresponding file content.

$template_part_file_path = get_stylesheet_directory() . '/block-template-parts/' . $attributes['slug'] . '.html';
$template_part_file_path = get_stylesheet_directory() . '/parts/' . $attributes['slug'] . '.html';
//echo $template_part_file_path;
if ( 0 === validate_file( $attributes['slug'] ) && file_exists( $template_part_file_path ) ) {
$content = file_get_contents( $template_part_file_path );
} else {
$template_part_file_path = get_template_directory() . '/block-template-parts/' . $attributes['slug'] . '.html';
$template_part_file_path = get_template_directory() . '/parts/' . $attributes['slug'] . '.html';
//echo $template_part_file_path;
if ( file_exists( $template_part_file_path ) ) {
$content = file_get_contents($template_part_file_path);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="WP_DEBUG">Wizzie front-page.html</div>
<!-- /wp:html -->

<!-- wp:template-part {"slug":"header","theme":"wizzie","tagName":"header","align":"full"} /-->
<!-- wp:template-part {"slug":"header","tagName":"header","align":"full"} /-->

<!-- wp:woocommerce/featured-product {"editMode":false,"productId":69011} -->
<!-- wp:button {"align":"center"} -->
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 4f70d4e

Please sign in to comment.