add actual version
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
ini_set('display_errors', 1);
|
||||
error_reporting(E_ERROR);
|
||||
//ini_set('display_errors', 0);
|
||||
//error_reporting(E_ALL);
|
||||
|
||||
header('Content-Type: text/html; charset=utf-8');
|
||||
|
||||
@@ -8,7 +8,30 @@ require get_theme_file_path('clear-functions.php');
|
||||
require "dirty-functions.php";
|
||||
require "garbage-functions.php";
|
||||
require "block-cache-manager.php"; //кешируем долгоживущие блоки
|
||||
require "inc/cache-cleaner-home.php";
|
||||
require 'inc/article-rss-feed.php'; //rss ленты статей по датам
|
||||
require "inc/meta_keywords.php";
|
||||
require "inc/journal_issue.php"; //номера журналов
|
||||
require "inc/rank-description.php";
|
||||
|
||||
//scheduler
|
||||
require "inc/schedule_async_post_processing.php";
|
||||
if ( defined( 'WP_CLI' ) && WP_CLI ) {
|
||||
require "inc/action-scheduler-functions.php";
|
||||
require "inc/wp-cli-scheduler-commands.php";
|
||||
require "inc/adfox_on.php"; // управление adfox
|
||||
}
|
||||
|
||||
include "inc/get_cached_alm.php";
|
||||
include "inc/graphql.php";
|
||||
|
||||
if (is_admin()) {
|
||||
require "inc/add_adv_checked.php"; // рекламная статья
|
||||
require "inc/admin/auto_check.php"; // помечакм не отправлять в Дзен
|
||||
require "inc/admin/lock-terms.php"; // banned и keys
|
||||
}
|
||||
|
||||
|
||||
|
||||
//TODO: Убрать все эти is_yn, is_zen и прочее и внутри плагинов регулировать вывод
|
||||
//TODO: Убрать все posts_where, переписать в pre_get_posts
|
||||
@@ -1035,9 +1058,13 @@ add_action('wp_enqueue_scripts', function() {
|
||||
);
|
||||
|
||||
// Добавляем стиль
|
||||
|
||||
$css_url = get_template_directory_uri() . '/assets/css/profile-style.css';
|
||||
//$css_url = 'https://profile.ru//wp-content/themes/profile/assets/css/profile-style.css';
|
||||
|
||||
wp_enqueue_style(
|
||||
'profile-style', // уникальный идентификатор
|
||||
get_template_directory_uri() . '/assets/css/profile-style.css', // путь к файлу
|
||||
$css_url, // путь к файлу
|
||||
array(), // зависимости
|
||||
filemtime(get_template_directory() . '/assets/css/profile-style.css') // версия
|
||||
);
|
||||
@@ -1076,11 +1103,18 @@ function hide_revisions_style() {
|
||||
|
||||
add_action('admin_footer', 'check_content_layout');
|
||||
function check_content_layout() {
|
||||
if(get_current_user_id() == 1){return;}
|
||||
if (get_current_user_id() == 53) {
|
||||
|
||||
//if(get_current_user_id() == 1 or ){return;}
|
||||
|
||||
$user = wp_get_current_user();
|
||||
if (in_array('administrator', $user->roles)) {
|
||||
return;
|
||||
}
|
||||
|
||||
//if (get_current_user_id() == 53) {
|
||||
//echo '<script>console.log("т-c-c-c;")</script>';
|
||||
//return;
|
||||
}
|
||||
//}
|
||||
echo <<<EOL
|
||||
<script>
|
||||
document.forms.post.onsubmit = function(e) {
|
||||
@@ -3041,6 +3075,7 @@ function send_telegram($post) {
|
||||
$curr_url = fix_broken_url($curr_url, 'profile.ru'); //корректируем ссылку с ошиюбками
|
||||
|
||||
|
||||
|
||||
if(has_tag(103565, $post_id)){
|
||||
$chat_id = "-1001241573514";//идентификатор канала profile_lifestyle
|
||||
|
||||
@@ -4802,15 +4837,17 @@ function customize_my_wp_admin_bar( $wp_admin_bar ) {
|
||||
|
||||
|
||||
|
||||
add_filter( 'pre_insert_term', 'deny_term_creation', 10, 2 );
|
||||
// add_filter( 'pre_insert_term', 'deny_term_creation', 10, 2 );
|
||||
function deny_term_creation( $term, $taxonomy ) {
|
||||
if ( !user_has_role(get_current_user_id(),'administrator') && !user_has_role(get_current_user_id(),'chief_editor') ) {
|
||||
//if(!in_array(get_current_user_id(), array(1,3)) && in_array($taxonomy, array('post_tag', 'banned'))){
|
||||
return new WP_Error( 'error', 'НЕЛЬЗЯ СОЗДАВАТЬ МЕТКИ!' );
|
||||
// Таксономия будет 'post_tag'
|
||||
if ( $taxonomy === 'post_tag' ) {
|
||||
if ( !user_has_role(get_current_user_id(),'administrator') && !user_has_role(get_current_user_id(),'chief_editor') ) {
|
||||
return new WP_Error( 'error', 'НЕЛЬЗЯ СОЗДАВАТЬ МЕТКИ!' );
|
||||
}
|
||||
}
|
||||
return $term;
|
||||
}
|
||||
|
||||
add_filter( 'pre_insert_term', 'deny_term_creation', 10, 2 );
|
||||
|
||||
|
||||
|
||||
@@ -6071,13 +6108,6 @@ add_filter( 'http_request_args',
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user