禁用古腾堡侧边栏中的“粘在博客顶部”和“待审核”

问题描述 投票:0回答:2

Wordpress 的最新版本(可能是从 5.8 版本开始)在帖子侧边栏中具有以下新选项:

enter image description here

“粘在博客顶部”和“等待审核”对于我的网站来说尤其是不必要的,占用了不必要的空间,最重要的是,在客户和最终用户眼中造成了精神混乱。

有没有办法禁用它们,或者如果失败,就隐藏它们?

wordpress wordpress-rest-api wordpress-gutenberg
2个回答
1
投票

因为其他元素有直接类,所以我使用了 :not css 语句(找不到真正的编程解决方案)

.components-panel .edit-post-post-status > .components-panel__row:not(
  .edit-post-post-visibility, 
  .edit-post-post-schedule, 
  .edit-post-post-author, 
  :last-child) {
  display: none;
}

必须显示的每个面板都需要包含在一个 :not 语句中,如果分开给单个听众,他们会蚕食自己。 “最后一个孩子”是垃圾按钮,它也没有自己的类名。


0
投票

嗯,WordPress 端的不良实践编码(不为元素指定特定类,而是为通用类)只能有不良实践解决方案:

//hide stick to the top of the blog checkbox
function inline_custom_admin_style() {
echo '<style>
.editor-post-author__panel {
        margin-top:-50px !important;
    }
.post-author-selector{background: white;}
</style>';
}
add_action('admin_head', 'inline_custom_admin_style');

上述解决方案对我不起作用。我的解决方案将作者框移到“粘贴到博客顶部”复选框上方,并将作者框设置为白色以确保其覆盖它。丑陋,但有效。

© www.soinside.com 2019 - 2024. All rights reserved.