This commit is contained in:
GP_DEV
2025-07-08 14:21:19 +03:00
parent a6bb81cbe1
commit 21562852ca
65 changed files with 7464 additions and 1073 deletions

View File

@@ -61,7 +61,7 @@ function register_acf_blocks() {
acf_register_block_type(array(
'name' => 'club-cards-block',
'title' => __('Блок с клубными картами'),
'description' => __('Блок с клубными картами для текущего языка'),
'description' => __('Блок с клубными картами для текущего зала'),
'render_template' => 'template-parts/la-components/blocks/club-cards-block/club-cards-block.php',
'category' => 'theme-blocks',
'icon' => 'id-alt',
@@ -73,6 +73,36 @@ function register_acf_blocks() {
),
));
acf_register_block_type(array(
'name' => 'trainer-block',
'title' => __('Блок с тренерами'),
'description' => __('Блок с тренерами для текущего зала'),
'render_template' => 'template-parts/la-components/blocks/trainers-block/trainer-block.php',
'category' => 'theme-blocks',
'icon' => 'id-alt',
'keywords' => array('тренеры', 'тренер', 'trainers'),
'supports' => array(
'align' => array('wide', 'full'),
'anchor' => true,
'customClassName' => true,
),
));
acf_register_block_type(array(
'name' => 'training-block',
'title' => __('Блок с тренировками'),
'description' => __('Блок с тренировками для текущего зала'),
'render_template' => 'template-parts/la-components/blocks/training-block/training-block.php',
'category' => 'theme-blocks',
'icon' => 'id-alt',
'keywords' => array('тренировки', 'тренеровка', 'trainings'),
'supports' => array(
'align' => array('wide', 'full'),
'anchor' => true,
'customClassName' => true,
),
));
acf_register_block_type(array(
'name' => 'form-block',
'title' => __('Блок формы'),
@@ -93,6 +123,13 @@ function register_acf_blocks() {
[],
'1.0.0'
);
wp_enqueue_script(
'form-block-js',
get_template_directory_uri() . '/template-parts/la-components/blocks/form-block/form-block.js',
['jquery'],
'1.0.0',
true
);
}
));
@@ -111,6 +148,51 @@ function register_acf_blocks() {
),
));
acf_register_block_type(array(
'name' => 'line-block',
'title' => __('Блок преимуществ в линию'),
'description' => __('Блок преимуществ в линию'),
'render_template' => 'template-parts/la-components/blocks/line-block/line-block.php',
'category' => 'theme-blocks',
'icon' => 'grid-view',
'keywords' => array('плитки', 'преимущества', 'line', 'линия'),
'supports' => array(
'align' => array('wide', 'full'),
'anchor' => true,
'customClassName' => true,
),
));
acf_register_block_type(array(
'name' => 'masonry-tiles-block',
'title' => __('Блок с высокой первой плиткой'),
'description' => __('Блок с высокой первой плиткой'),
'render_template' => 'template-parts/la-components/blocks/masonry-tiles-1/masonry-tiles-1.php',
'category' => 'theme-blocks',
'icon' => 'grid-view',
'keywords' => array('плитки', 'карточки', 'tiles', 'cards'),
'supports' => array(
'align' => array('wide', 'full'),
'anchor' => true,
'customClassName' => true,
),
));
acf_register_block_type(array(
'name' => 'masonry-wide-tiles-block',
'title' => __('Блок с широкой последней плиткой'),
'description' => __('Блок с широкой последней плиткой'),
'render_template' => 'template-parts/la-components/blocks/masonry-tiles-2/masonry-tiles-2.php',
'category' => 'theme-blocks',
'icon' => 'grid-view',
'keywords' => array('плитки', 'карточки', 'tiles', 'cards'),
'supports' => array(
'align' => array('wide', 'full'),
'anchor' => true,
'customClassName' => true,
),
));
acf_register_block_type(array(
'name' => 'advantages-block',
@@ -148,6 +230,28 @@ function register_acf_blocks() {
'1.0.0',
true
);
wp_enqueue_style(
'glightbox-css',
'https://cdnjs.cloudflare.com/ajax/libs/glightbox/3.2.0/css/glightbox.min.css',
[],
'3.2.0'
);
wp_enqueue_script(
'glightbox-js',
'https://cdnjs.cloudflare.com/ajax/libs/glightbox/3.2.0/js/glightbox.min.js',
[],
'3.2.0',
true
);
wp_enqueue_style(
'reviews-block-css',
get_template_directory_uri() . '/template-parts/la-components/blocks/reviews-block/reviews-block.css',
[],
'1.0.0'
);
}
));
@@ -182,6 +286,12 @@ function register_acf_blocks() {
true
);
wp_enqueue_style(
'gallery-block-css',
get_template_directory_uri() . '/template-parts/la-components/blocks/gallery-tabs/gallery-tabs.css',
[],
'1.0.0'
);
wp_enqueue_script(
'gallery-tabs-js',
@@ -192,6 +302,46 @@ function register_acf_blocks() {
);
}
));
acf_register_block_type(array(
'name' => 'simple-gallery',
'title' => __('Галерея с текстом'),
'description' => __('Галерея с текстом'),
'render_template' => 'template-parts/la-components/blocks/simple-gallery/simple-gallery.php',
'category' => 'theme-blocks',
'icon' => 'images-alt2',
'keywords' => array('gallery', 'tabs', 'slider', 'галерея', 'слайдер'),
'supports' => array(
'align' => array('wide', 'full'),
'anchor' => true,
'customClassName' => true,
),
'enqueue_assets' => function() {
wp_enqueue_style(
'glightbox-css',
'https://cdnjs.cloudflare.com/ajax/libs/glightbox/3.2.0/css/glightbox.min.css',
[],
'3.2.0'
);
wp_enqueue_script(
'glightbox-js',
'https://cdnjs.cloudflare.com/ajax/libs/glightbox/3.2.0/js/glightbox.min.js',
[],
'3.2.0',
true
);
wp_enqueue_script(
'simple-gallery-js',
get_template_directory_uri() . '/template-parts/la-components/blocks/simple-gallery/simple-gallery.js',
['swiper-js', 'glightbox-js'],
'1.0.0',
true
);
}
));
}
}
add_action('acf/init', 'register_acf_blocks');