add spavochniki and rfo

This commit is contained in:
argoexpert press
2025-05-26 19:33:14 +03:00
parent 569c838c47
commit f2d7deeedf
10 changed files with 500 additions and 7 deletions

View File

@@ -2,6 +2,7 @@
setlocale(LC_TIME, 'ru_RU.UTF-8');
require get_template_directory() . '/inc/rubrics-menu.php'; // Рубрики в меню
require get_template_directory() . '/inc/spravochniki.php'; // Подключаем справочники
// Полностью отключить XML-RPC
add_filter( 'xmlrpc_enabled', '__return_false' );
@@ -1277,7 +1278,7 @@ function replace_first_figure_in_content($content) {
add_filter('get_terms', function($terms, $taxonomies, $args) {
global $pagenow;
if (($pagenow === 'post.php' || $pagenow === 'post-new.php') && in_array('category', $taxonomies)) {
$exclude_ids = [7]; // ID рубрик, которые нужно скрыть
$exclude_ids = [7, 740, 741, 742, 743, 744, 745, 746, 762]; // ID рубрик, которые нужно скрыть
$terms = array_filter($terms, fn($term) => !in_array($term->term_id, $exclude_ids));
}
return $terms;
@@ -1285,7 +1286,7 @@ add_filter('get_terms', function($terms, $taxonomies, $args) {
// Для REST API (панель справа в редакторе Gutenberg)
add_filter('rest_category_query', function($args, $request) {
$args['exclude'] = [7]; // Те же ID, что и выше
$args['exclude'] = [7, 740, 741, 742, 743, 744, 745, 746, 762]; // Те же ID, что и выше
return $args;
}, 10, 2);