Adds option to disable lighbox on the main slider.

This commit is contained in:
mateuswetah 2021-09-06 16:32:50 -03:00
parent d95727854b
commit 4c2810a5a2
5 changed files with 32 additions and 3 deletions

View File

@ -106,7 +106,7 @@ if ( !function_exists('tainacan_blocksy_gallery_light_color_scheme') ) {
function tainacan_blocksy_gallery_light_color_scheme() {
$prefix = blocksy_manager()->screen->get_prefix();
$has_light_dark_color_scheme = get_theme_mod( $prefix . '_galery_color_scheme', 'dark' ) == 'light';
$has_light_dark_color_scheme = get_theme_mod( $prefix . '_gallery_color_scheme', 'dark' ) == 'light';
if (!$has_light_dark_color_scheme)
return;

View File

@ -0,0 +1,21 @@
<?php
if (! isset($prefix)) {
$prefix = '';
}
if (! isset($enabled)) {
$enabled = 'no';
}
$options = [
$prefix . 'disable_gallery_lightbox' => [
'label' => __( 'Disable lightbox on main view', 'tainacan-blocksy' ),
'type' => 'ct-switch',
'value' => $enabled,
'setting' => [ 'transport' => 'postMessage' ],
'desc' => __( 'Toggle to not open a modal when clicking in the document.', 'tainacan-blocksy' ),
'sync' => blocksy_sync_single_post_container([
'prefix' => $prefix,
]),
]
];

View File

@ -29,6 +29,10 @@ $options = [
'prefix' => $prefix,
'enabled' => 'no'
], false),
blocksy_get_options(TAINACAN_BLOCKSY_PLUGIN_DIR_PATH . '/inc/options/single-elements/disable-gallery-lightbox.php', [
'prefix' => $prefix,
'enabled' => 'no'
], false),
blocksy_get_options(TAINACAN_BLOCKSY_PLUGIN_DIR_PATH . '/inc/options/single-elements/hide-files-name.php', [
'prefix' => $prefix,
'enabled' => 'no'

View File

@ -9,6 +9,7 @@
$hide_file_caption_main = get_theme_mod( $prefix . '_hide_files_caption_main', 'yes') == 'yes';
$hide_file_description_main = get_theme_mod( $prefix . '_hide_files_description_main', 'yes') == 'yes';
$hide_download_button = get_theme_mod( $prefix . '_hide_download_button', 'no' ) == 'yes';
$disable_gallery_lightbox = get_theme_mod( $prefix . '_disable_gallery_lightbox', 'no');
global $post;
@ -125,7 +126,8 @@
'nextEl' => '.swiper-navigation-next_' . 'tainacan-item-attachments_id-' . $post->ID . '-main',
'prevEl' => '.swiper-navigation-prev_' . 'tainacan-item-attachments_id-' . $post->ID . '-main',
)
) : ''
) : '',
'disable_lightbox' => $is_gallery_mode ? $disable_gallery_lightbox : false,
)
);
?>

View File

@ -7,6 +7,7 @@
$hide_file_caption_main = get_theme_mod( $prefix . '_hide_files_caption_main', 'yes') == 'yes';
$hide_file_description_main = get_theme_mod( $prefix . '_hide_files_description_main', 'yes') == 'yes';
$hide_download_button = get_theme_mod( $prefix . '_hide_download_button', 'no' ) == 'yes';
$disable_gallery_lightbox = get_theme_mod( $prefix . '_disable_gallery_lightbox', 'no');
global $post;
@ -57,7 +58,8 @@
'nextEl' => '.swiper-navigation-next_' . 'tainacan-item-document_id-' . $post->ID . '-main',
'prevEl' => '.swiper-navigation-prev_' . 'tainacan-item-document_id-' . $post->ID . '-main',
)
)
),
'disable_lightbox' => $disable_gallery_lightbox,
)
);