Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions plugins/woocommerce/includes/class-wc-template-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,17 @@ private static function has_block_template( $template_name ) {
return false;
}

return is_readable(
get_stylesheet_directory() . '/block-templates/' . $template_name . '.html'
);
$has_template = is_readable( get_stylesheet_directory() . '/block-templates/' . $template_name . '.html' );

/**
* Filters the value of the result of the block template check.
*
* @since x.x.x
*
* @param boolean $has_template value to be filtered.
* @param string $template_name The name of the template.
*/
return (bool) apply_filters( 'woocommerce_has_block_template', $has_template, $template_name );
}

/**
Expand Down