繁体   English   中英

如何摆脱子菜单工具提示?

[英]How to get rid of submenu tooltips?

将鼠标悬停在wordpress后端具有子菜单页面的菜单项上时,会弹出一个“工具提示”,显示每个子菜单页面。

我该如何摆脱这些?

在此处输入图片说明

到目前为止,我已经尝试过:删除wp-has-submenu样式类。 这有效-有点。 悬停时,工具提示不再显示。 在将鼠标悬停在某个项目上时,工具提示仍会出现。

    $('#adminmenu').children('li').each(function () {
        $(this).removeClass('wp-has-submenu');
    // removing or changing the value of the 'aria-haspopup' attr doesn't solve the problem. Not sure what the attr is for
    //  $(this).children('a').each(function(){
    //      $(this).attr('aria-haspopup', 'false');
    //  });
    });

更新1

好吧,这似乎是纯JavaScript而不是jQuery。 我已经从任何元素中删除了任何事件绑定。 仍显示工具提示。

    $('html').find("*").each(function () {
        $(this).off();
        $(this).unbind();
    });

AFAIK和一个简短的google,如果没有对实际处理程序的引用,就无法删除纯js事件处理程序。

更新2

嗯,通过/wp-admin/js/ ,似乎所有事情或至少很多事情都是在jQuery中完成的。。。。。

更新3

在搜索/查找和编辑许多.js文件之后,我决定删除/wp-admin/js/wp-includes/js 它仍然出现。 神圣..他们到底在干什么。

更新4

这似乎有效

.js #adminmenu .opensub .wp-submenu {
    display:none !important;
}


是的,您的代码正在运行。 但是我在这里描述了一种在主题中添加此代码的简单方法,它将删除admin部分中的悬停效果。
按照步骤。

Step-1: add this code in functions.php file of your theme.
function theme_name_scripts() { wp_enqueue_style( 'admin-hovermenu', get_template_directory_uri() ."/admin.css" ); }add_action( 'admin_enqueue_scripts', 'theme_name_scripts' );
Step:2 Create a file named admin.css and add this line in that file.
.js #adminmenu .opensub .wp-submenu { display:none !important; }
现在就可以了。如果需要其他任何功能,请告诉我。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM