forked from Licoy/wordpress-theme-puock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmetas.php
30 lines (28 loc) · 1022 Bytes
/
metas.php
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
<?php
function pk_metas_get_async_view_id()
{
if (pk_is_checked('async_view') && (is_page() || is_single())) {
return get_the_ID();
}
return null;
}
$headMetas = [
'home' => home_url(),
'vd_comment' => pk_is_checked('vd_comment'),
'vd_gt_id' => pk_get_option('vd_gt_id'),
'vd_type' => pk_get_option('vd_type', 'img'),
'use_post_menu' => pk_is_checked('use_post_menu'),
'is_single' => is_single(),
'is_pjax' => pk_is_checked('page_ajax_load'),
'main_lazy_img' => pk_is_checked('basic_img_lazy_z'),
'link_blank_open' => pk_is_checked('link_blank_content'),
'async_view_id' => pk_metas_get_async_view_id(),
'mode_switch' => pk_is_checked('theme_mode_s'),
'off_img_viewer'=>pk_is_checked('off_img_viewer'),
'off_code_highlighting'=>pk_is_checked('off_code_highlighting'),
];
if($headMetas['async_view_id']){
$headMetas['async_view_generate_time'] = time();
}
?>
<script data-instant>var puock_metas =<?php echo json_encode($headMetas) ?>;</script>