In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to add and delete WordPress background management menu separators. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
Add and delete WordPress background management menu separator
I wonder if you have noticed that there is an empty delimiter under the WordPress background dashboard and comment menu, but not under other menus, as shown below:
The delimiter code is located in the wp-admin directory menu.php file.
Line 62:
$menu [4] = array ('', 'read',' separator1','', 'wp-menu-separator')
Line 184:
$menu [59] = array (',', 'read',' separator2',', 'wp-menu-separator')
Many years ago, users responded to WP's official suggestion to remove delimiters. Officials said that delimiters are used to separate different management modules and are not pre-adopted, but delimiters have no style but a height, so there is no reservation.
Delete delimiter
If you don't like this abrupt spaced space as I do, the easiest way to delete this separator is to delete those two lines of code in the menu.php file directly, but the next update program will delete it again, which is a troublesome way to do it once and for all:
Just add the following code to the theme function template functions.php.
Function zm_remove_menu () {global $menu;unset ($menu [4]); unset ($menu [59]);} add_action ('admin_head',' zm_remove_menu')
If you want to delete other menu items, open the menu.php file to check the location number of the corresponding menu item, for example, the media is $menu [10], and add a sentence to the above code:
Unset ($menu [10])
With this kind of launch.
Menu location number
2 dashboard 4 delimiters 5 articles 10 media 15 links 20 pages 25 comments 59 delimiters 60 appearance 65 plug-ins 70 users 75 tools 80 settings 99 separators
Other ways to delete menus are attached
Add delimiter
As a theme designer, if you want to add a delimiter to the theme customization menu to prompt the user that this is theme-specific, for example, under the media menu numbered 10, you can write:
Add_action ('admin_menu', function () {global $menu;$menu [11] = [', 'read',' wp-menu-separator'];})
Define the delimiter style
If you want to define this separator style, you can write it this way.
Function zm_separator_style () {echo'.separator {border-bottom: 1px solid # 2271b1;}';} add_action ('admin_head',' zm_separator_style')
Also added to the theme function template functions.php.
Move menu location
If you want to customize the menu location, such as moving the article menu under the media menu, you can write:
Function zm_move_menu () {global $menu;$menu [11] = $menu [5]; / / move the article menu numbered 5 to unset under the media menu numbered 10 ($menu [5]); / / remove the original article menu} add_action ('admin_menu',' zm_move_menu')
Others, and so on.
This is the end of this article on "adding and deleting WordPress background management menu separators". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.