[英]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');
// });
});
好吧,這似乎是純JavaScript而不是jQuery。 我已經從任何元素中刪除了任何事件綁定。 仍顯示工具提示。
$('html').find("*").each(function () {
$(this).off();
$(this).unbind();
});
AFAIK和一個簡短的google,如果沒有對實際處理程序的引用,就無法刪除純js事件處理程序。
嗯,通過/wp-admin/js/
,似乎所有事情或至少很多事情都是在jQuery中完成的。。。。。
在搜索/查找和編輯許多.js文件之后,我決定刪除/wp-admin/js
和/wp-includes/js
。 它仍然出現。 神聖..他們到底在干什么。
這似乎有效
.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.