Return to Snippet

Revision: 72699
at November 1, 2017 08:02 by cusmin


Initial Code
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');

Initial URL

                                

Initial Description
Please add this code to functions.php
This will add admin menu separators between all admin menu items.

Initial Title
Add Admin Menu Separators

Initial Tags
plugin

Initial Language
PHP