WordPress.org

Make WordPress Core

Changeset 9989


Ignore:
Timestamp:
11/30/2008 10:47:26 PM (11 years ago)
Author:
westi
Message:

Ensure we never have two seperators together.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/menu.php

    r9949 r9989  
    175175}
    176176
     177// Remove any duplicated seperators
     178$seperator_found = false;
     179foreach ( $menu as $id => $data ) {
     180    if ( 0 == strcmp('wp-menu-separator', $data[4] ) ) {
     181        if (false == $seperator_found) {
     182            $seperator_found = true;
     183        } else {
     184            unset($menu[$id]);
     185            $seperator_found = false;
     186        }
     187    } else {
     188        $seperator_found = false;
     189    }
     190}
     191
    177192unset($id);
    178193
Note: See TracChangeset for help on using the changeset viewer.