From b1697d2b5a0a9fd07ac0e9655bd3604cfd505b7a Mon Sep 17 00:00:00 2001 From: Vij Project Date: Wed, 4 Jun 2025 01:32:16 +0300 Subject: [PATCH] add cookies --- blocks/mobile-subscript.php | 3 +++ cookie-consent.php | 6 ++++++ functions.php | 8 ++++++++ lang.php | 2 +- partials/formsubscript.php | 2 ++ vite.config.php | 2 +- 6 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 cookie-consent.php diff --git a/blocks/mobile-subscript.php b/blocks/mobile-subscript.php index 7c904d0..effed9a 100644 --- a/blocks/mobile-subscript.php +++ b/blocks/mobile-subscript.php @@ -13,6 +13,9 @@ $ihash = add_hash_frm();?> +
Нажимая на кнопку, Вы соглашаетесь на обработку персональных данных в соответствии с + «Политикой конфиденциальности»
+ \ No newline at end of file diff --git a/cookie-consent.php b/cookie-consent.php new file mode 100644 index 0000000..76af6b1 --- /dev/null +++ b/cookie-consent.php @@ -0,0 +1,6 @@ + \ No newline at end of file diff --git a/functions.php b/functions.php index ce60ed1..ea1ae6c 100644 --- a/functions.php +++ b/functions.php @@ -268,6 +268,14 @@ add_filter( 'single_template', function ( $single_template ) { }, PHP_INT_MAX, 2 ); +//куки +function add_cookie_consent() { + if (!isset($_COOKIE['cookie_consent_accepted'])) { + get_template_part('cookie-consent'); + } +} +add_action('wp_footer', 'add_cookie_consent'); + #search function my_search_order( $query ) { diff --git a/lang.php b/lang.php index 602324e..92b7a09 100644 --- a/lang.php +++ b/lang.php @@ -7,7 +7,7 @@ function vij_lang($name, $lan){ static $lang_ru = [ 'link_version' => '/', - 'path_logo' => '/pub/logo/80_vizh_logo.svg', + 'path_logo' => '/pub/logo/vij_logo.svg', 'mainmenu' => 'topmenu', 'mob_rub_menu' => 'mob_rubrics', 'mob_main_menu' => 'topmobmenu', diff --git a/partials/formsubscript.php b/partials/formsubscript.php index 9384875..35e43bd 100755 --- a/partials/formsubscript.php +++ b/partials/formsubscript.php @@ -15,5 +15,7 @@ $ihash = add_hash_frm();?> +
Нажимая на кнопку, Вы соглашаетесь на обработку персональных данных в соответствии с +«Политикой конфиденциальности»
\ No newline at end of file diff --git a/vite.config.php b/vite.config.php index c35555a..4b2e677 100755 --- a/vite.config.php +++ b/vite.config.php @@ -33,7 +33,7 @@ add_action( 'wp_enqueue_scripts', function () { $style_ver = filemtime(get_template_directory() . $fstyle); $script_ver = filemtime(get_template_directory() . $fscript); - wp_enqueue_style('vij-style', get_template_directory_uri() . $fstyle, array(), $style_ver.'8'); + wp_enqueue_style('vij-style', get_template_directory_uri() . $fstyle, array(), $style_ver.'10'); wp_enqueue_script('vij-script', get_template_directory_uri() . $fscript, array(), $script_ver, 5); }