Files
profile/admin-header.php

347 lines
10 KiB
PHP
Raw Normal View History

2025-07-09 21:21:17 +03:00
<?php if(get_current_user_id() == 145): ?>
<style>
.misc-pub-section.curtime.misc-pub-curtime,
.inline-edit-date {
display:none !important;
}
</style>
<?php endif; ?>
<?php if(get_post_status(get_the_ID()) == 'publish' && !in_array(get_current_user_id(), [58,3,1])): ?>
<style>
#radio-categorydiv {
display:none!important;
}
</style>
<?php endif; ?>
<style>
#formatdiv, #commentstatusdiv, #trackbacksdiv, #postexcerpt, #slugdiv {
display:none!important;
}
pre{
margin-left:300px;
}
div[data-notice-name="update-44-notice"],
.inline-edit-status /*убираем статус в быстром редактировании*/,
#imgevr-offer-to-purchase,
.subsubsub .count
<?php if(!in_array(get_current_user_id(), array(16,58))): ?>
,.subsubsub .publish
<?php endif; ?>
{
display:none!important;
}
#the-list > tr.seo td.page-title strong {
text-indent:-9999px;
position:relative;
}
#the-list > tr.seo td.page-title strong a {
display:block;
text-indent:0px;
}
#poststuff #_submitdiv .inside {
margin: 0;
padding: 0;
}
</style>
<!--div style="position:fixed;width:100%;height:100%;top:0;left:0;z-index:999998;"></div-->
<?php if(current_user_can('corrector')): ?>
<style>
a[href^="post-new.php"],
input[name="publish"]{
display:none!important;
}
</style>
<?php endif; ?>
<?php if (!current_user_can('administrator') && !current_user_can('managing_editor')): ?>
<style>
#front-page-warning,
#front-static-pages ul,
.categorydiv ul.categorychecklist ul,
.customlinkdiv ul.categorychecklist ul,
.inline-editor ul.cat-checklist ul,
.posttypediv ul.categorychecklist ul,
.taxonomydiv ul.categorychecklist ul,
ul.export-filters {
margin-left:0px!important;
}
li[id^="category-"] > label,
li[id^="popular-category-"] {
display:none;
}
li[id="category-3394"] > label,
li[id="category-3394"] ul.children,
li[id="popular-category-3394"] {
display: block !important;
}
li[id="category-8529"] > label,
li[id="category-8529"] ul.children,
li[id="popular-category-8529"] {
display: block !important;
}
li[id="category-3392"] > label,
li[id="category-3392"] ul.children,
li[id="popular-category-3392"] {
display: block !important;
}
li[id="category-103061"] > label,
li[id="category-103061"] ul.children,
li[id="popular-category-103061"] {
display: block !important;
}
li[id="category-3388"] > label,
li[id="category-3388"] ul.children,
li[id="popular-category-3388"] {
display: block !important;
}
li[id="category-11430"] > label,
li[id="category-11430"] ul.children,
li[id="popular-category-11430"] {
display: block !important;
}
li[id="category-12857"] > label,
li[id="category-12857"] ul.children,
li[id="popular-category-12857"] {
display: block !important;
}
li[id="category-12876"] > label,
li[id="category-12876"] ul.children,
li[id="popular-category-12876"] {
display: block !important;
}
li[id="category-91781"] > label,
li[id="category-91781"] ul.children,
li[id="popular-category-91781"] {
display: block !important;
}
li[id="category-6973"] > label,
li[id="category-6973"] ul.children,
li[id="popular-category-6973"] {
display: block !important;
}
li[id="category-103061"] > label,
li[id="category-103061"] ul.children,
li[id="popular-category-103061"] {
display: block !important;
}
li[id="category-3358"] > label,
li[id="category-3358"] ul.children,
li[id="popular-category-3358"] {
display: block !important;
}
<?php
$menus = wp_get_nav_menus();
$menusToShow = array();
foreach ($menus as $menu){
$menuitems = wp_get_nav_menu_items($menu);
foreach($menuitems as $menuitem){
if($menuitem->object == 'category' && !in_array($menuitem->object_id, array(8529, 3358, 105049))){
echo "
li[id='category-".$menuitem->object_id."'] > label,
li[id='popular-category-".$menuitem->object_id."'] {
display:block !important;
}
";
}
}
}
?>
</style>
<?php endif; ?>
<?php if(1==2): ?>
<!-- Yandex.Metrika counter admin-header -->
<script type="text/javascript" >
(function (d, w, c) {
(w[c] = w[c] || []).push(function() {
try {
w.yaCounter62899390 = new Ya.Metrika({
id:62899390,
clickmap:true,
trackLinks:true,
accurateTrackBounce:true,
webvisor:true,
trackHash:true
});
} catch(e) { }
});
var n = d.getElementsByTagName("script")[0],
s = d.createElement("script"),
f = function () { n.parentNode.insertBefore(s, n); };
s.type = "text/javascript";
s.async = true;
s.src = "https://mc.yandex.ru/metrika/watch.js";
if (w.opera == "[object Opera]") {
d.addEventListener("DOMContentLoaded", f, false);
} else { f(); }
})(document, window, "yandex_metrika_callbacks");
</script>
<noscript><div><img loading="lazy" src="https://mc.yandex.ru/watch/62899390" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
<!-- /Yandex.Metrika counter -->
<?php endif; ?>
<?php
if(user_has_role(get_current_user_id(), 'intern')){
?>
<style>
#menu-posts-yellow,
#menu-posts-profile_article,
#wp-admin-bar-new-yellow {
display:none;
}
</style>
<?php
}
if(user_has_role(get_current_user_id(), 'intern') || user_has_role(get_current_user_id(), 'newsline_editor') || user_has_role(get_current_user_id(), 'seniod_editor') || user_has_role(get_current_user_id(), 'authors')) : ?>
<style>
#menu-posts-profile_article > ul > li:nth-child(3),
#toplevel_page_wpseo_redirects,
#menu-pages,
#wp-admin-bar-delete-cache,
#menu-dashboard,
#wp-admin-bar-archive,
/*.subsubsub,*/
.subsubsub .trash,
.update-nag,
#menu-media > ul > li:last-of-type,
.alignleft.actions.bulkactions,
#wpseo-filter,
#wpseo-readability-filter,
#menu-comments,
#menu-tools,
#wp-admin-bar-new-custom-menu,
#wp-admin-bar-new-profile_article,
.yarpp-review-notice,
#wp-admin-bar-comments,
#wp-admin-bar-wpseo-menu,
#wp-admin-bar-amp
{display:none!important;}
</style>
<?php if(get_post_type() == 'profile_article'): ?>
<style>
div.row-actions,
#wp-admin-bar-edit,
#wpbody-content > div.wrap > a
{display:none!important;}
</style>
<?php endif; ?>
<?php endif; ?>
<?php
//Скрываем лишние колонки для Белоновской
if (in_array(get_current_user_id(), array(37))) : ?>
<style>
.column-comments,
.column-wpseo-links,
.column-wpseo-score,
.column-wpseo-score-readability,
.column-wpseo-title,
.column-wpseo-metadesc,
.column-wpseo-focuskw {
display:none;
}
.column-title.column-primary {
width:25%;
}
</style>
<?php endif; ?>
<?php if(current_user_can('bild')): ?>
<style>
#menu-posts-yellow,
#media-attachment-filters,
#media-attachment-date-filters,
button.media-button.select-mode-toggle-button,
#wp-admin-bar-new-yellow,
#wp-admin-bar-wpseo-menu,
#menu-comments,
#menu-posts-anew,
#menu-posts-profile_article,
#wp-admin-bar-comments,
#menu-tools,
#menu-users,
#wp-admin-bar-new-profile_article,
#wp-admin-bar-new-anew,
#wp-admin-bar-new-custom-menu,
.wp-submenu.wp-submenu-wrap > li:last-of-type,
/*select#author,*/
#post-query-submit,
#menu-dashboard,
#wp-admin-bar-my-account > div,
#attachment-filter {
display:none!important;
}
</style>
<?php endif; ?>
<?php if(!in_array(get_current_user_id(), array(1,3))): ?>
<style>
<?php $hide_categories = array(103061, 3390, 3392, 3393, 1, 3398, 3389, 3375, 3374, 3373, 3370, 3372, 6974, 3376, 3371, 3377, 8966, 3359, 3356, 3357, 3352, 3350, 3351, 3347, 3349, 8844, 8830, 3368, 3387, 3366, 3367, 3355, 3364, 3363, 3361, 3362, 3382, 3381, 3384, 3383); ?>
<?php foreach($hide_categories as $hc): ?>
li[id="category-<?php echo $hc; ?>"] > label,
li[id="popular-category-<?php echo $hc; ?>"] {
display: none!important;
position:absolute!important;
overflow:hidden!important;
width:0!important;
height:0!important;
position:fixed!important;
left:0!important;
top:0!important;
}
<?php endforeach; ?>
</style>
<?php endif; ?>
<style>
.coauthor-row img {
display:none;
}
.wpseo-score-icon {
width:16px;
height:16px;
background:#f17171;
border-radius:100%;
display:inline-block;
}
.wpseo-score-icon.good {
background:#a2d471;
}
#save-action > input,
#publishing-action > input {
float:left;
}
</style>
<link rel='stylesheet' type='text/css' href='<?php echo get_template_directory_uri(); ?>/assets/css/admin/jquery-ui.css' />