Skip to content

Commit 76026bd

Browse files
committed
Update from vk-blocks-pro
1 parent ff75298 commit 76026bd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+7987
-7115
lines changed

editor-css/_editor_before_tab.scss

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
margin-bottom:0;
1414
}
1515
}
16-
// .vk_tab_bodys_body と隣接する .block-list-appender だけを対象にする
17-
.vk_tab_bodys_body.block-editor-block-list__block + .block-list-appender {
16+
.block-list-appender{
1817
position: absolute;
1918
top: calc( 1rem * -6 );
2019
right: calc( 1rem * 0 );

inc/vk-blocks/load-vk-components.php

+11-42
Original file line numberDiff line numberDiff line change
@@ -8,58 +8,27 @@
88
use VektorInc\VK_Component\VK_Component_Posts;
99

1010
/**
11-
* VK Components(Bootstrap) を読み込むべきか判定
11+
* Boostrapの読み込み
1212
*
13-
* @return bool 読み込む場合 true、読み込まない場合 false
13+
* @param string $hook_suffix hook suffix.
1414
*/
15-
function vk_blocks_should_load_vk_components() {
15+
function vk_blocks_load_vk_components( $hook_suffix ) {
1616
$template = wp_get_theme()->Template;
17-
// lightning 系(ベクトル)の場合 vk-components はテーマなどで読み込むので適用しない
18-
$should_load = ! in_array( $template, array( 'lightning', 'lightning-pro', 'katawara' ), true );
19-
20-
return apply_filters( 'vk_blocks_should_load_vk_components', $should_load );
21-
}
22-
23-
// 条件に合わなければここで return することで、以降の処理を実行しない
24-
if ( ! vk_blocks_should_load_vk_components() ) {
25-
return;
26-
}
17+
// lightning 系(ベクトル)の場合 vk-components はテーマなどで読み込むので必要ない
18+
if ( 'lightning' === $template || 'lightning-pro' === $template || 'katawara' === $template ) {
19+
return;
20+
}
2721

28-
/**
29-
* VK Components(Bootstrap) の登録 & 読み込み
30-
*/
31-
function vk_blocks_register_vk_components_style() {
3222
VK_Component_Posts::register_style( 'vk-components-style' );
33-
}
34-
add_action( 'init', 'vk_blocks_register_vk_components_style' );
3523

36-
/**
37-
* VK Components(Bootstrap) を管理画面とフロントに適用
38-
*
39-
* @param string $hook_suffix hook suffix.
40-
*/
41-
function vk_blocks_enqueue_vk_components_style( $hook_suffix = '' ) {
24+
// 管理画面
4225
if ( is_admin() ) {
43-
if ( in_array( $hook_suffix, array( 'post.php', 'post-new.php' ), true ) ) {
26+
if ( 'post.php' === $hook_suffix || 'post-new.php' === $hook_suffix ) {
4427
wp_enqueue_style( 'vk-components-style' );
4528
}
4629
} else {
4730
wp_enqueue_style( 'vk-components-style' );
4831
}
4932
}
50-
add_action( 'admin_enqueue_scripts', 'vk_blocks_enqueue_vk_components_style' );
51-
add_action( 'wp_enqueue_scripts', 'vk_blocks_enqueue_vk_components_style' );
52-
53-
/**
54-
* エディター用の VK Components(Bootstrap) を適用
55-
*/
56-
function vk_blocks_enqueue_vk_components_editor_style() {
57-
// スタイルが登録されていない場合は登録
58-
if ( ! wp_style_is( 'vk-components-style', 'registered' ) ) {
59-
VK_Component_Posts::register_style( 'vk-components-style' );
60-
}
61-
62-
// スタイルを適用
63-
wp_enqueue_style( 'vk-components-style' );
64-
}
65-
add_action( 'enqueue_block_assets', 'vk_blocks_enqueue_vk_components_editor_style' );
33+
add_action( 'admin_enqueue_scripts', 'vk_blocks_load_vk_components' );
34+
add_action( 'wp_enqueue_scripts', 'vk_blocks_load_vk_components' );

0 commit comments

Comments
 (0)