>
data-bs-spy="scroll" data-bs-target=".toc-container" data-bs-offset="100"> true, 'show_on_mobile' => true, 'show_on_desktop' => true, 'icon_class' => 'bi bi-megaphone-fill', 'show_icon' => true, 'highlight_text' => 'Nuevo:', 'message_text' => 'Accede a más de 200,000 Análisis de Precios Unitarios actualizados para 2025.', 'link_text' => 'Ver Catálogo', 'link_url' => '/catalogo', 'link_target' => '_self', 'show_link' => true, 'custom_styles' => array( 'background_color' => '', 'text_color' => '', 'highlight_color' => '', 'link_hover_color' => '', 'font_size' => 'normal' ) ); $top_bar_config = isset($settings['components']['top_bar']) ? $settings['components']['top_bar'] : array(); $top_bar = wp_parse_args($top_bar_config, $top_bar_defaults); // Verificar si está habilitado if ($top_bar['enabled']): // Construir clases CSS $classes = array('top-notification-bar'); if (!$top_bar['show_on_mobile']) { $classes[] = 'd-none'; $classes[] = 'd-md-block'; } if (!$top_bar['show_on_desktop']) { $classes[] = 'd-md-none'; } $class_attr = implode(' ', $classes); // Construir estilos inline $inline_styles = array(); if (!empty($top_bar['custom_styles']['background_color'])) { $inline_styles[] = 'background-color: ' . esc_attr($top_bar['custom_styles']['background_color']); } if (!empty($top_bar['custom_styles']['text_color'])) { $inline_styles[] = 'color: ' . esc_attr($top_bar['custom_styles']['text_color']); } // Font size $font_size_map = array( 'small' => '0.8rem', 'normal' => '0.9rem', 'large' => '1rem' ); if (isset($font_size_map[$top_bar['custom_styles']['font_size']])) { $inline_styles[] = 'font-size: ' . $font_size_map[$top_bar['custom_styles']['font_size']]; } $style_attr = !empty($inline_styles) ? ' style="' . implode('; ', $inline_styles) . '"' : ''; ?>