From 79ee038c9cae39cd5145828d7d3432fe8d43ee45 Mon Sep 17 00:00:00 2001 From: argoexpert press Date: Tue, 27 Aug 2024 01:07:35 +0300 Subject: [PATCH 1/8] off api --- content-about.php | 4 ++-- functions.php | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/content-about.php b/content-about.php index aaf3e54..40e9db5 100644 --- a/content-about.php +++ b/content-about.php @@ -64,11 +64,11 @@ 'image' => 'https://vetandlife.ru/wp-content/uploads/2021/12/plonsky_107.jpg' ], - '11' => [ + /** '11' => [ 'name' => 'Алла Орехова', 'position' => 'Менеджер по рекламе', 'image' => 'https://agroexpert.press/wp-content/uploads/2024/07/alla-orehova.jpg' - ], + ], */ '12' => [ 'name' => 'Юлия Дерябина', diff --git a/functions.php b/functions.php index 0fdc8a0..8f82070 100644 --- a/functions.php +++ b/functions.php @@ -1,6 +1,19 @@ Date: Fri, 6 Sep 2024 10:56:22 +0300 Subject: [PATCH 2/8] delete calendar events --- functions.php | 17 +++++++++++++++++ header.php | 1 + widgets/upcoming-events-widget-template.php | 2 -- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/functions.php b/functions.php index 8f82070..af6a856 100644 --- a/functions.php +++ b/functions.php @@ -14,6 +14,23 @@ add_filter( 'xmlrpc_methods', function( $methods ) { add_filter('rest_enabled', '__return_false'); add_filter('rest_jsonp_enabled', '__return_false'); +function redirect_non_admin_users() { + // Получаем текущего пользователя + $current_user = wp_get_current_user(); + + // Проверяем, если пользователь не является администратором + if (in_array('subscriber', $current_user->roles) || in_array('author', $current_user->roles)) { + // Если это запрос к административной панели или если пользователь пытается получить доступ к wp-admin + if (is_admin()) { + // Перенаправляем на главную страницу сайта + wp_redirect(home_url()); + exit; + } + } +} +add_action('admin_init', 'redirect_non_admin_users'); + + define('ENPART', 740); define('EN_PARTS', '746,741,742,743,744,745'); diff --git a/header.php b/header.php index 90b00c3..79202fd 100644 --- a/header.php +++ b/header.php @@ -13,6 +13,7 @@ +