Make WordPress Core

Changeset 19236


Ignore:
Timestamp:
11/10/2011 12:42:39 AM (12 years ago)
Author:
nacin
Message:

Promote secondary admin bar items to primary if there are no primary items at time of render. see #19136, #19221.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class-wp-admin-bar.php

    r19230 r19236  
    160160
    161161    function recursive_render( $node ) {
    162         $is_parent = ! empty( $node->children->primary );
     162        if ( ! $node->children->primary && $node->children->secondary ) {
     163            $node->children->primary = $node->children->secondary;
     164            $node->children->secondary = array();
     165        }
     166
     167        $is_parent = (bool) $node->children->primary;
    163168
    164169        $menuclass = $is_parent ? 'menupop' : '';
Note: See TracChangeset for help on using the changeset viewer.