Skip to content

Commit

Permalink
Merge pull request #1035 from vektor-inc/fix/load_block_path
Browse files Browse the repository at this point in the history
【確認中】ブロックを読み込んでいるパスをsrcからbuildに変更
  • Loading branch information
kurudrive authored Mar 1, 2022
2 parents 605b6f4 + 0d0aacc commit 9ab9e4d
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
Original file line number Diff line number Diff line change
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 9ab9e4d

Please sign in to comment.