Ensure we never have two seperators together.

git-svn-id: http://svn.automattic.com/wordpress/trunk@9989 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
westi 2008-11-30 22:47:26 +00:00
parent 086dccd3bd
commit cb9dd57472
1 changed files with 15 additions and 0 deletions

View File

@ -174,6 +174,21 @@ foreach ( $menu as $id => $data ) {
}
}
// Remove any duplicated seperators
$seperator_found = false;
foreach ( $menu as $id => $data ) {
if ( 0 == strcmp('wp-menu-separator', $data[4] ) ) {
if (false == $seperator_found) {
$seperator_found = true;
} else {
unset($menu[$id]);
$seperator_found = false;
}
} else {
$seperator_found = false;
}
}
unset($id);
function add_cssclass($add, $class) {