/ Published in: PHP
Please add this code to functions.php
This will add admin menu separators between all admin menu items.
This will add admin menu separators between all admin menu items.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function wp_admin_add_separators(){ ?> <script type="text/javascript"> var addSeparators = function(){ jQuery('#adminmenu > li').each(function(){ var $this = jQuery(this); var $next = $this.next(); if($next && !$this.hasClass('wp-menu-separator') && !$next.hasClass('wp-menu-separator')){ $next.before('<li class="wp-not-current-submenu wp-menu-separator" aria-hidden="true"><div class="separator"></div></li>'); } }); }; var checkForSeparators = setInterval(function(){ if(jQuery('#adminmenu').size()){ addSeparators(); clearInterval(checkForSeparators); } }, 20); </script> <?php } add_action('admin_head', 'wp_admin_add_separators');