diff --git a/footer-pets.php b/footer-pets.php index 6f84811..6a4ac5f 100644 --- a/footer-pets.php +++ b/footer-pets.php @@ -316,24 +316,7 @@ document.write(' - - + diff --git a/footer.php b/footer.php index 43a31a3..75e8281 100644 --- a/footer.php +++ b/footer.php @@ -321,24 +321,7 @@ document.write(' - - + diff --git a/functions.php b/functions.php index 5447b6f..53bbd81 100644 --- a/functions.php +++ b/functions.php @@ -4,6 +4,20 @@ if (! defined( 'ABSPATH' )) { exit; } +// Полностью отключить XML-RPC +add_filter( 'xmlrpc_enabled', '__return_false' ); + +// Отключение методов XML-RPC, требующих авторизации +add_filter( 'xmlrpc_methods', function( $methods ) { + unset( $methods['pingback.ping'] ); + return $methods; +} ); + + +// Полное отключение REST API +add_filter('rest_enabled', '__return_false'); +add_filter('rest_jsonp_enabled', '__return_false'); + ini_set('display_errors','off'); use PHPMailer\PHPMailer\PHPMailer; @@ -1033,3 +1047,15 @@ function convert_images_to_amp($content) { } add_filter('the_content', 'convert_images_to_amp'); + +// подписчики на главную +add_action('admin_init', 'restrict_subscriber_admin_access'); +function restrict_subscriber_admin_access() { + // Проверяем, что пользователь вошел в систему и имеет роль 'subscriber' + if (current_user_can('subscriber')) { + // Перенаправляем на главную страницу сайта + wp_redirect(home_url()); + exit; + } +} + diff --git a/index.php b/index.php index e6ca90c..430d17b 100644 --- a/index.php +++ b/index.php @@ -8,6 +8,7 @@ get_header(); $nn = 0;?> +

Главное

@@ -30,7 +31,7 @@ $nn = 0;?> ) ) ); # фильтруем рубрики -?> +?> have_posts()) : ?>