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

git-svn-id: http://svn.automattic.com/wordpress/trunk@19236 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2011-11-10 00:42:39 +00:00
parent 019fa9e1e7
commit c3fb2795b0

View File

@ -159,7 +159,12 @@ class WP_Admin_Bar {
}
function recursive_render( $node ) {
$is_parent = ! empty( $node->children->primary );
if ( ! $node->children->primary && $node->children->secondary ) {
$node->children->primary = $node->children->secondary;
$node->children->secondary = array();
}
$is_parent = (bool) $node->children->primary;
$menuclass = $is_parent ? 'menupop' : '';
if ( ! empty( $node->meta['class'] ) )