This commit is contained in:
2024-08-27 01:09:00 +03:00
parent 689a195c9d
commit 2cf8c378b0
4 changed files with 30 additions and 37 deletions

View File

@@ -316,24 +316,7 @@ document.write('<img src="'+pr+'?uid=18820&ref='+r+'&rd='+rd+'" width="88" heigh
</footer> </footer>
<?php get_template_part( 'partials/formhash' );?> <?php get_template_part( 'partials/formhash' );?>
<!-- Yandex.RTB R-A-4145099-7 -->
<script>
(function renderInImage(images) {
if (!images.length) {
return
}
const image = images.shift()
image.id = `yandex_rtb_R-A-4145099-7-${Math.random().toString(16).slice(2)}`
window.yaContextCb.push(() => {
Ya.Context.AdvManager.render({
"renderTo": image.id,
"blockId": "R-A-4145099-7",
"type": "inImage"
})
})
renderInImage(images)
})(Array.from(document.querySelectorAll("#post-img")))
</script>
</body> </body>
</html> </html>

View File

@@ -321,24 +321,7 @@ document.write('<img src="'+pr+'?uid=18820&ref='+r+'&rd='+rd+'" width="88" heigh
</footer> </footer>
<?php get_template_part( 'partials/formhash' );?> <?php get_template_part( 'partials/formhash' );?>
<!-- Yandex.RTB R-A-4145099-7 -->
<script>
(function renderInImage(images) {
if (!images.length) {
return
}
const image = images.shift()
image.id = `yandex_rtb_R-A-4145099-7-${Math.random().toString(16).slice(2)}`
window.yaContextCb.push(() => {
Ya.Context.AdvManager.render({
"renderTo": image.id,
"blockId": "R-A-4145099-7",
"type": "inImage"
})
})
renderInImage(images)
})(Array.from(document.querySelectorAll("#post-img")))
</script>
</body> </body>
</html> </html>

View File

@@ -4,6 +4,20 @@ if (! defined( 'ABSPATH' )) {
exit; 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'); ini_set('display_errors','off');
use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\PHPMailer;
@@ -1033,3 +1047,15 @@ function convert_images_to_amp($content) {
} }
add_filter('the_content', 'convert_images_to_amp'); 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;
}
}

View File

@@ -8,6 +8,7 @@
get_header(); get_header();
$nn = 0;?> $nn = 0;?>
<div id="content"> <div id="content">
<h1 id="mainpage-title">Главное</h1> <h1 id="mainpage-title">Главное</h1>
@@ -30,7 +31,7 @@ $nn = 0;?>
) )
) )
); # фильтруем рубрики ); # фильтруем рубрики
?> ?>
<?php if($query->have_posts()) : ?> <?php if($query->have_posts()) : ?>