ソースを参照

Update header pattern loading (#5955)

Changed from get_template_dir() to get_theme_file_path() so that headers in the child theme override Blockbase.
colinduwe 3 年 前
コミット
ad5c836978
1 ファイル変更1 行追加1 行削除
  1. 1 1
      blockbase/inc/block-patterns.php

+ 1 - 1
blockbase/inc/block-patterns.php

@@ -52,7 +52,7 @@ if ( ! function_exists( 'blockbase_register_block_patterns' ) ) :
 						'title'      => __( 'Blockbase Header (' . $header_pattern . ')', 'blockbase' ),
 						'categories' => array( 'header' ),
 						'blockTypes' => array( 'core/template-part/header' ),
-						'content'    => file_get_contents (get_template_directory() . '/block-template-parts/header-' . $header_pattern . '.html'),
+						'content'    => file_get_contents (get_theme_file_path( '/block-template-parts/header-' . $header_pattern . '.html' )),
 					)
 				);
 			}