Jake Vanderwerf
2026-04-26 5697a1c3af703f04902c0422c0536c88899ebb27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
 
function aei_render_core_site_logo(array $block, string $content):string
{
    $open = $close = '';
 
    if (!is_home() && !is_front_page()) {
        $open = '<a href="'.get_home_url().'" rel="home">';
        $close = '</a>';
    }
    $cache = (class_exists('JVBase\managers\Cache')) ? JVBase\managers\Cache::for('full-icons') : false;
 
    if (array_key_exists('className', $block['attrs'])) {
        $logo = false;
        if (str_contains($block['attrs']['className'], 'is-proper')) {
            $logo = '<img class="logo" src="'.AEI_URL.'/assets/tatty-soap-rose-header.webp">';
        }
        if ($logo) {
            return $open.$logo.$close;
        }
    }
 
    return JVB()->blocks()->render_core_site_logo($block, $content);
}
 
function aei_render_core_template_part(array $block, string $content): string
{
    if (!array_key_exists('attrs', $block) || !array_key_exists('slug', $block['attrs']) || !in_array($block['attrs']['slug'], ['header', 'footer'])){
        return JVB()->blocks()->render_core_template_part($block, $content);
    }
    $content = JVB()->blocks()->render_core_template_part($block, $content);
    $icon = file_get_contents(AEI_DIR .'/assets/icons/background.svg');
    $search = str_contains($content, '<header>') ? '</header>' : '</footer>';
    return str_replace($search, $icon.$search, $content);
 
}