Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Account for classic theme support of template parts
Browse files Browse the repository at this point in the history
  • Loading branch information
nerrad committed Jun 9, 2023
1 parent 488bde2 commit 540d07f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/BlockTemplatesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ public function get_block_file_template( $template, $id, $template_type ) {
* @return array
*/
public function add_block_templates( $query_result, $query, $template_type ) {
if ( ! BlockTemplateUtils::supports_block_templates() ) {
if ( ! BlockTemplateUtils::supports_block_templates( 'wp_template_part' === $template_type ) ) {
return $query_result;
}

Expand Down
2 changes: 1 addition & 1 deletion src/BlockTypes/MiniCart.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ protected function enqueue_data( array $attributes = [] ) {

if (
current_user_can( 'edit_theme_options' ) &&
wc_current_theme_is_fse_theme()
( wc_current_theme_is_fse_theme() || current_theme_supports( 'block-template-parts' ) )
) {
$theme_slug = BlockTemplateUtils::theme_has_template_part( 'mini-cart' ) ? wp_get_theme()->get_stylesheet() : BlockTemplateUtils::PLUGIN_SLUG;

Expand Down

0 comments on commit 540d07f

Please sign in to comment.