Diff: STRATO-apps/wordpress_03/app/wp-content/themes/blocksy/inc/footer.php
Keine Baseline-Datei – Diff nur gegen leer.
1
-
1
+
<?php
2
+
3
+
if (! function_exists('blocksy_output_drawer_canvas')) {
4
+
function blocksy_output_drawer_canvas($location = 'start') {
5
+
$default_footer_elements = [];
6
+
7
+
global $blocksy_has_default_header;
8
+
9
+
if ($location === 'start') {
10
+
$elements = new Blocksy_Header_Builder_Elements();
11
+
12
+
if (
13
+
isset($blocksy_has_default_header)
14
+
&&
15
+
$blocksy_has_default_header
16
+
) {
17
+
ob_start();
18
+
$elements->render_search_modal();
19
+
$default_footer_elements[] = ob_get_clean();
20
+
21
+
$default_footer_elements[] = $elements->render_offcanvas();
22
+
}
23
+
}
24
+
25
+
if ($location === 'end') {
26
+
if (blocksy_get_theme_mod('has_back_top', 'no') === 'yes') {
27
+
ob_start();
28
+
blocksy_output_back_to_top_link();
29
+
$default_footer_elements[] = ob_get_clean();
30
+
}
31
+
}
32
+
33
+
$footer_elements = apply_filters(
34
+
'blocksy:footer:offcanvas-drawer',
35
+
$default_footer_elements,
36
+
[
37
+
'blocksy_has_default_header' => $blocksy_has_default_header,
38
+
'location' => $location
39
+
]
40
+
);
41
+
42
+
if (! empty($footer_elements)) {
43
+
$attr = [
44
+
'class' => 'ct-drawer-canvas',
45
+
'data-location' => $location
46
+
];
47
+
48
+
foreach ($footer_elements as $footer_el) {
49
+
$content = $footer_el;
50
+
51
+
if (is_array($footer_el) && isset($footer_el['attr'])) {
52
+
$attr = array_merge($attr, $footer_el['attr']);
53
+
}
54
+
}
55
+
56
+
echo '<div ' . blocksy_attr_to_html($attr) . '>';
57
+
58
+
if ($location === 'end') {
59
+
echo '<div class="ct-drawer-inner">';
60
+
}
61
+
62
+
foreach ($footer_elements as $footer_el) {
63
+
$content = $footer_el;
64
+
65
+
if (is_array($footer_el) && isset($footer_el['content'])) {
66
+
$content = $footer_el['content'];
67
+
}
68
+
69
+
echo $content;
70
+
}
71
+
72
+
if ($location === 'end') {
73
+
echo '</div>';
74
+
}
75
+
76
+
echo '</div>';
77
+
}
78
+
}
79
+
}
80
+
81
+
add_action('wp_body_open', function () {
82
+
if (! is_admin()) {
83
+
blocksy_output_drawer_canvas('start');
84
+
}
85
+
}, 60);
86
+
87
+
add_action(
88
+
'wp_footer',
89
+
function () {
90
+
blocksy_output_drawer_canvas('end');
91
+
}
92
+
);
93
+