Skip to content

Commit

Permalink
fix / load_block_path
Browse files Browse the repository at this point in the history
ブロックをロードするパスをsrcからbuildに変更
関連 #1034
WordPress/gutenberg#38715
  • Loading branch information
shimotmk committed Feb 25, 2022
1 parent 7a82c77 commit 0d0aacc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions inc/vk-blocks/class-vk-blocks-block-loader.php
Expand Up @@ -249,7 +249,7 @@ public function separate_assets_load_reducer( $args ) {
}

foreach ( $this->get_block_names( array( 'is_pro' => true ) ) as $block_name ) {
if ( file_exists( VK_BLOCKS_SRC_PATH . '/blocks/_pro/' . $block_name . '/index.php' ) ) {
if ( file_exists( VK_BLOCKS_DIR_PATH . 'inc/vk-blocks/build/blocks/_pro/' . $block_name . '/index.php' ) ) {
if ( ! empty( $args['style'] ) && 'vk-blocks/' . $block_name === $args['style'] ) {
$args['style'] = null;
$args['script'] = null;
Expand Down Expand Up @@ -324,9 +324,9 @@ public static function should_load_separate_assets() {
public function load_block( $block_name ) {
$block_info = $this->get_block_info( $block_name );

$require_file_path = VK_BLOCKS_SRC_PATH . '/blocks/' . $block_name . '/index.php';
$require_file_path = VK_BLOCKS_DIR_PATH . 'inc/vk-blocks/build/blocks/' . $block_name . '/index.php';
if ( $block_info['is_pro'] ) {
$require_file_path = VK_BLOCKS_SRC_PATH . '/blocks/_pro/' . $block_name . '/index.php';
$require_file_path = VK_BLOCKS_DIR_PATH . 'inc/vk-blocks/build/blocks/_pro/' . $block_name . '/index.php';
}

if ( file_exists( $require_file_path ) ) {
Expand All @@ -342,7 +342,7 @@ public function load_block( $block_name ) {
* @return void
*/
public function load_block_style( $block_style_name ) {
$require_file_path = VK_BLOCKS_SRC_PATH . 'extensions/core/' . $block_style_name['name'] . '/index.php';
$require_file_path = VK_BLOCKS_DIR_PATH . 'inc/vk-blocks/build/extensions/core/' . $block_style_name['name'] . '/index.php';
if ( file_exists( $require_file_path ) ) {
require_once $require_file_path;
}
Expand Down

0 comments on commit 0d0aacc

Please sign in to comment.