Skip to content

Commit

Permalink
fix : adjust setting&function
Browse files Browse the repository at this point in the history
  • Loading branch information
osmdik committed Dec 1, 2022
1 parent da2f20f commit f900714
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 97 deletions.
8 changes: 1 addition & 7 deletions inc/vk-blocks-pro/vk-blocks-pro-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,5 @@ function vk_blocks_pro_load_scripts() {

// Animation Block
wp_enqueue_script( 'vk-blocks-animation', VK_BLOCKS_DIR_URL . 'build/vk-animation.min.js', array(), VK_BLOCKS_VERSION, true );

// Slider Block
global $vk_swiper_url;
wp_enqueue_style( 'vk-swiper-style', $vk_swiper_url . 'assets/css/swiper.min.css', array(), SWIPER_VERSION );

wp_enqueue_script( 'vk-blocks-slider', VK_BLOCKS_DIR_URL . 'build/vk-slider.min.js', array( 'vk-swiper-script' ), VK_BLOCKS_VERSION, true );
}
add_action( 'wp_enqueue_scripts', 'vk_blocks_pro_load_scripts' );
add_action( 'wp_enqueue_scripts', 'vk_blocks_pro_load_scripts' );
18 changes: 9 additions & 9 deletions inc/vk-blocks/class-vk-blocks-global-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,14 @@ public static function blocks() {
'name' => 'pr-content',
'is_pro' => false,
),
array(
'name' => 'slider',
'is_pro' => false,
),
array(
'name' => 'slider-item',
'is_pro' => false,
),
array(
'name' => 'spacer',
'is_pro' => false,
Expand Down Expand Up @@ -189,14 +197,6 @@ public static function blocks() {
'name' => 'select-post-list-item',
'is_pro' => true,
),
array(
'name' => 'slider',
'is_pro' => true,
),
array(
'name' => 'slider-item',
'is_pro' => true,
),
array(
'name' => 'step',
'is_pro' => true,
Expand All @@ -221,4 +221,4 @@ public static function blocks() {
return $blocks;
}

}
}
10 changes: 10 additions & 0 deletions inc/vk-blocks/vk-blocks-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,3 +224,13 @@ function vk_blocks_set_wp_version() {
}
add_action( 'admin_head', 'vk_blocks_set_wp_version', 10, 0 );
}

function vk_blocks_load_scripts() {

// Slider Block
global $vk_swiper_url;
wp_enqueue_style( 'vk-swiper-style', $vk_swiper_url . 'assets/css/swiper.min.css', array(), SWIPER_VERSION );

wp_enqueue_script( 'vk-blocks-slider', VK_BLOCKS_DIR_URL . 'build/vk-slider.min.js', array( 'vk-swiper-script' ), VK_BLOCKS_VERSION, true );
}
add_action( 'wp_enqueue_scripts', 'vk_blocks_load_scripts' );
4 changes: 2 additions & 2 deletions src/blocks/slider-item/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function vk_blocks_register_block_slider_item() {
if ( ! is_admin() ) {
wp_register_style(
'vk-blocks/slider-item',
VK_BLOCKS_DIR_URL . 'build/_pro/slider-item/style.css',
VK_BLOCKS_DIR_URL . 'build/slider-item/style.css',
array(),
VK_BLOCKS_VERSION
);
Expand All @@ -30,4 +30,4 @@ function vk_blocks_register_block_slider_item() {
)
);
}
add_action( 'init', 'vk_blocks_register_block_slider_item', 99 );
add_action( 'init', 'vk_blocks_register_block_slider_item', 99 );
4 changes: 2 additions & 2 deletions src/blocks/slider/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function vk_blocks_register_block_slider() {
if ( ! is_admin() ) {
wp_register_style(
'vk-blocks/slider',
VK_BLOCKS_DIR_URL . 'build/_pro/slider/style.css',
VK_BLOCKS_DIR_URL . 'build/slider/style.css',
array( 'vk-swiper-style' ),
VK_BLOCKS_VERSION
);
Expand All @@ -42,4 +42,4 @@ function vk_blocks_register_block_slider() {
)
);
}
add_action( 'init', 'vk_blocks_register_block_slider', 99 );
add_action( 'init', 'vk_blocks_register_block_slider', 99 );
Loading

0 comments on commit f900714

Please sign in to comment.