/ Published in: PHP

Add this snippet to theme's functions.php
Add menu items that will have separator after them to $separatorsAfter array.
Add menu items that will have separator after them to $separatorsAfter array.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
add_action('admin_init', 'add_separators_admin_menu'); function add_separators_admin_menu() { //ADD SEPARATORS AFTER THESE MENU ITEMS $separatorsAfter = ['Media', 'Plugins', 'Settings', 'WooCommerce']; /////////////////////////////////////// global $menu; if (is_admin()) { 0 => '', 1 => 'read', 2 => 'separator-last', 3 => '', 4 => 'wp-menu-separator' ))); break; } } } } }
Comments
