| | |
| | | // Enqueue the feed block script (it will automatically load dependencies) |
| | | $this->localize_feedblock(); |
| | | } |
| | | if ($block['blockName'] === 'jvb/forms') { |
| | | wp_enqueue_style('jvb-form'); |
| | | } |
| | | return $content; |
| | | } |
| | | |
| | |
| | | if (str_contains($url[1], 'maps.apple.com')) { |
| | | $icon = 'apple-logo'; |
| | | } |
| | | |
| | | if ($icon !== '') { |
| | | return sprintf( |
| | | '<li%s><a href="%s" title="Find Us On %s">%s Maps</a></li>', |
| | |
| | | protected function render_core_group(array $block):string |
| | | { |
| | | $tag = (array_key_exists('tagName', $block['attrs'])) ? $block['attrs']['tagName'] : 'div'; |
| | | |
| | | $classes = ($tag === 'main') ? |
| | | $this->getClassesAndStyles($block['attrs']) : |
| | | '' : |
| | | $this->getClassesAndStyles($block['attrs'], ['group']); |
| | | return '<'.$tag.$classes.'>'.$this->innerBlocks($block).'</'.$tag.'>'; |
| | | } |
| | |
| | | wp_get_attachment_caption($ID) . |
| | | '</figcaption>' : |
| | | '<figcaption>' . $title . '</figcaption>'; |
| | | |
| | | $size = array_key_exists('sizeSlug', $block['attrs']) ? $block['attrs']['sizeSlug'] : 'large'; |
| | | return '<figure'. |
| | | $this->getClassesAndStyles($block['attrs']).'>'. |
| | | $this->imageLink(true, $ID) . |
| | | $this->imageLink(true, $ID, 'tiny', $size) . |
| | | $caption.'</figure>'; |
| | | } |
| | | |
| | |
| | | { |
| | | |
| | | $ID = $this->imageID('', $block); |
| | | $imgLink = ($ID) ? $this->imageLink(true, $ID) : ''; |
| | | |
| | | $size = array_key_exists('mediaSizeSlug', $block['attrs']) ? $block['attrs']['mediaSizeSlug'] : 'large'; |
| | | $imgLink = ($ID) ? $this->imageLink(true, $ID, 'tiny', $size) : ''; |
| | | |
| | | $inner = $this->innerBlocks($block); |
| | | |
| | |
| | | home_url($block['attrs']['url']) : |
| | | $block['attrs']['url']; |
| | | $current = (home_url($wp->request.'/') == $url); |
| | | |
| | | $temp = $block['attrs']; |
| | | unset($temp['url']); |
| | | $classes = ($current) ? |
| | | $this->getClassesAndStyles($block['attrs'], ['current']): |
| | | $this->getClassesAndStyles($block['attrs']); |
| | | $this->getClassesAndStyles($temp, ['current']): |
| | | $this->getClassesAndStyles($temp); |
| | | $aria = ''; |
| | | if ($current) { |
| | | $aria = ' aria-current="page"'; |
| | |
| | | $block['attrs']['url']; |
| | | $current = (home_url($wp->request) == $url); |
| | | |
| | | $temp = $block['attrs']; |
| | | unset($temp['url']); |
| | | $classes = ($current) ? |
| | | $this->getClassesAndStyles($block['attrs'], ['has-submenu', 'current']): |
| | | $this->getClassesAndStyles($block['attrs'], ['has-submenu']); |
| | | $this->getClassesAndStyles($temp, ['has-submenu', 'current']): |
| | | $this->getClassesAndStyles($temp, ['has-submenu']); |
| | | |
| | | $aria = ''; |
| | | if ($current) { |
| | |
| | | $title = ($checked == '') ? 'Toggle Dark Mode' : 'Toggle Light Mode'; |
| | | $showThemeSwitch = (bool)apply_filters('jvb_show_theme_switch', true); |
| | | $themeSwitch = ($showThemeSwitch) ? '<label title="'.$title.'" id="theme-switch" class="toggle-switch" for="theme-switcher"> |
| | | <input class="theme-switch row" id="theme-switcher" type="checkbox"'.$checked.' data-setting="theme" data-theme role="switch" name="dark-mode"><span class="slider">'. |
| | | <input class="theme-switch row" id="theme-switcher" name="theme-switcher" type="checkbox"'.$checked.' data-setting="theme" data-theme role="switch" name="dark-mode" aria-label="Toggle dark mode"><span class="slider">'. |
| | | jvbIcon('sun-dim', ['title'=> 'Light Mode']). |
| | | jvbIcon('moon', ['title'=>'Dark Mode']). |
| | | '</span></label>' : ''; |
| | | $breadcrumbs = jvbBuildBreadcrumbs(); |
| | | $afterHeader = apply_filters('jvbBelowHeader', $afterHeader); |
| | | |
| | | if ($afterHeader !== '') { |
| | | $afterHeader = '<aside class="sub-header">'.$afterHeader.'</aside>'; |
| | | } |
| | | $footerText = '<div class="scroll-progress"><div class="bar"></div> |
| | | </div>'; |
| | | } elseif ($isFooterTemplate) { |
| | | $beforeHeader = apply_filters('jvbBeforeFooter', ''); |
| | | if ($beforeHeader !== '') { |
| | |
| | | $type = 'row'; |
| | | if (array_key_exists('type', $value)) { |
| | | $type = 'col'; |
| | | if ($value['type'] === 'constrained') { |
| | | $classes[] = 'container col'; |
| | | } |
| | | // if ($value['type'] === 'constrained') { |
| | | // $classes[] = 'container col'; |
| | | // } |
| | | } |
| | | if (array_key_exists('orientation', $value)) { |
| | | $type = 'col'; |
| | |
| | | |
| | | // Background URL (for cover, media blocks) |
| | | case 'url': |
| | | jvbDump($value); |
| | | if (!empty($value) && str_starts_with($value, 'http')) { |
| | | $styles[] = 'background-image: url('.$value.')'; |
| | | } |