Adds media gallery thumbnails image size option.

This commit is contained in:
mateuswetah 2024-05-17 17:09:20 -03:00
parent 2342e4fcbc
commit d45adb87d3
3 changed files with 17 additions and 2 deletions

View File

@ -5,6 +5,17 @@ if (! isset($prefix)) {
}
$options = [
$prefix . 'thumbnails_image_size' => [
'label' => __('Thumbnails image size', 'blocksy'),
'type' => 'ct-select',
'value' => 'tainacan-medium',
'view' => 'text',
'design' => 'inline',
'sync' => '',
'choices' => blocksy_ordered_keys(
blocksy_get_all_image_sizes()
),
],
$prefix . 'attachments_size' => [
'label' => __( 'Attachments size on carousel', 'tainacan-blocksy' ),
'type' => 'ct-slider',

View File

@ -17,6 +17,7 @@
$hide_file_caption_lightbox = get_theme_mod( $prefix . '_hide_files_caption_lightbox', 'no') == 'yes';
$hide_file_description_lightbox = get_theme_mod( $prefix . '_hide_files_description_lightbox', 'no') == 'yes';
$has_light_dark_color_scheme = get_theme_mod( $prefix . '_gallery_color_scheme', 'dark' ) == 'light';
$thumbnails_image_size = get_theme_mod( $prefix . '_thumbnails_image_size', 'tainacan-medium' );
if ( $is_gallery_mode && $gallery_position !== 'below' ) {
add_filter( 'tainacan-swiper-thumbs-options', function($options) {
@ -78,7 +79,8 @@
'hideFileCaptionLightbox' => $hide_file_caption_lightbox,
'hideFileDescriptionLightbox' => $hide_file_description_lightbox,
'openLightboxOnClick' => $is_gallery_mode ? !$disable_gallery_lightbox : true,
'lightboxHasLightBackground' => $has_light_dark_color_scheme
'lightboxHasLightBackground' => $has_light_dark_color_scheme,
'thumbnailsSize' => $thumbnails_image_size
]);
?>
</section>

View File

@ -15,6 +15,7 @@
$hide_file_caption_lightbox = get_theme_mod( $prefix . '_hide_files_caption_lightbox', 'no') == 'yes';
$hide_file_description_lightbox = get_theme_mod( $prefix . '_hide_files_description_lightbox', 'no') == 'yes';
$has_light_dark_color_scheme = get_theme_mod( $prefix . '_gallery_color_scheme', 'dark' ) == 'light';
$thumbnails_image_size = get_theme_mod( $prefix . '_thumbnails_image_size', 'tainacan-medium' );
if ( $gallery_spacing === 'minimum' ) {
add_filter( 'tainacan-swiper-thumbs-options', function($options) {
@ -54,7 +55,8 @@
'hideFileCaptionLightbox' => $hide_file_caption_lightbox,
'hideFileDescriptionLightbox' => $hide_file_description_lightbox,
'openLightboxOnClick' => $is_gallery_mode ? !$disable_gallery_lightbox : true,
'lightboxHasLightBackground' => $has_light_dark_color_scheme
'lightboxHasLightBackground' => $has_light_dark_color_scheme ,
'thumbnailsSize' => $thumbnails_image_size
]);
?>
</section>