Fixes background-color variable missing and avoids conflicts of view mode function.

This commit is contained in:
mateuswetah 2022-05-09 17:16:50 -03:00
parent cb1a928359
commit b96ea0539b
6 changed files with 33 additions and 29 deletions

View File

@ -99,32 +99,34 @@ add_filter('post_class', 'tainacan_blocksy_post_class');
*
* @return array An associative array with view mode options and the default one
*/
function tainacan_get_default_view_mode_choices() {
$default_view_mode = '';
$enabled_view_modes = [];
if ( !function_exists('tainacan_get_default_view_mode_choices') ) {
function tainacan_get_default_view_mode_choices() {
$default_view_mode = '';
$enabled_view_modes = [];
if (function_exists('tainacan_get_the_view_modes')) {
$view_modes = tainacan_get_the_view_modes();
$default_view_mode = $view_modes['default_view_mode'];
$enabled_view_modes = [];
foreach ($view_modes['registered_view_modes'] as $key => $view_mode) {
if (!$view_mode['full_screen'])
$enabled_view_modes[$key] = $view_mode['label'];
}
} else {
$default_view_mode = 'masonry';
$enabled_view_modes = [
'masonry' => __('Masonry', 'tainacan-interface'),
'cards' => __('Cards', 'tainacan-interface'),
'table' => __('Table', 'tainacan-interface'),
'grid' => __('Grid', 'tainacan-interface')
];
}
return [
'default_view_mode' => $default_view_mode,
'enabled_view_modes' => $enabled_view_modes
];
if (function_exists('tainacan_get_the_view_modes')) {
$view_modes = tainacan_get_the_view_modes();
$default_view_mode = $view_modes['default_view_mode'];
$enabled_view_modes = [];
foreach ($view_modes['registered_view_modes'] as $key => $view_mode) {
if (!$view_mode['full_screen'])
$enabled_view_modes[$key] = $view_mode['label'];
}
} else {
$default_view_mode = 'masonry';
$enabled_view_modes = [
'masonry' => __('Masonry', 'tainacan-interface'),
'cards' => __('Cards', 'tainacan-interface'),
'table' => __('Table', 'tainacan-interface'),
'grid' => __('Grid', 'tainacan-interface')
];
}
return [
'default_view_mode' => $default_view_mode,
'enabled_view_modes' => $enabled_view_modes
];
}
}

View File

@ -15,6 +15,7 @@
--tainacan-block-gray3: var(--formBorderInitialColor, #e0e5eb);
--tainacan-block-gray4: var(--color, rgba(44, 62, 80, 0.9));
--tainacan-block-gray5: var(--headingColor, rgba(44, 62, 80, 1));
--background-color: var(--paletteColor7);
}
// Grid mixin for display: grid compatibility

View File

@ -14,6 +14,7 @@
--tainacan-block-gray3: var(--formBorderInitialColor, #e0e5eb);
--tainacan-block-gray4: var(--color, rgba(44, 62, 80, 0.9));
--tainacan-block-gray5: var(--headingColor, rgba(44, 62, 80, 1));
--background-color: var(--paletteColor7);
}
/* Remaining imports */

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long