Admin Menu: remove duplicated separators, and use strpos()
(instead of strcmp()
) when determining if the separator CSS class is present.
Props rilwis, chriscct7. Fixes #24104. git-svn-id: https://develop.svn.wordpress.org/trunk@34861 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
02804492e3
commit
d71eb86075
@ -181,12 +181,11 @@ unset($id, $data, $subs, $first_sub);
|
||||
// Remove any duplicated separators
|
||||
$separator_found = false;
|
||||
foreach ( $menu as $id => $data ) {
|
||||
if ( 0 == strcmp('wp-menu-separator', $data[4] ) ) {
|
||||
if ( false !== strpos( $data[4], 'wp-menu-separator' ) ) {
|
||||
if ( ! $separator_found ) {
|
||||
$separator_found = true;
|
||||
} else {
|
||||
unset($menu[$id]);
|
||||
$separator_found = false;
|
||||
}
|
||||
} else {
|
||||
$separator_found = false;
|
||||
|
Loading…
Reference in New Issue
Block a user