add files inc

This commit is contained in:
Profile Profile
2026-03-09 20:51:08 +03:00
parent 83ca6c638a
commit ed4d79b706
23 changed files with 3728 additions and 4 deletions

38
inc/admin/auto_check.php Normal file
View File

@@ -0,0 +1,38 @@
<?php
function add_auto_check_script_to_post_edit() {
$screen = get_current_screen();
if ($screen && $screen->base === 'post') {
?>
<script type="text/javascript">
jQuery(document).ready(function($) {
// Проверяем, что это новый пост
if (window.location.href.indexOf('post-new.php') > -1) {
// Ждем загрузки DOM
setTimeout(function() {
// Устанавливаем атрибут checked="checked" для нужных чекбоксов
const checkboxes = [
'input[name="yzrssenabled_meta_value"][type="checkbox"]',
'input[name="ynrss_exclude"][type="checkbox"]',
'input[name="_send_telegram"][type="checkbox"]'
//'input[name="_hide_on_mainpage"][type="checkbox"]',
// Добавьте другие чекбоксы здесь:
// 'input[name="_another_field"][type="checkbox"]',
];
checkboxes.forEach(function(selector) {
const $checkbox = $(selector);
if ($checkbox.length) {
$checkbox.attr('checked', 'checked');
$checkbox.prop('checked', true);
//console.log('Установлен checked для:', selector);
}
});
}, 100);
}
});
</script>
<?php
}
}
add_action('admin_footer', 'add_auto_check_script_to_post_edit');