Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【確認中】ブロックを読み込んでいるパスをsrcからbuildに変更 #1035

Merged
merged 1 commit into from
Mar 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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