From ba5c2141bbd5305107cc26d343f971ebb4514c73 Mon Sep 17 00:00:00 2001 From: nacin Date: Thu, 18 Aug 2011 06:16:57 +0000 Subject: [PATCH] Some more class instantiations. props eko-fr, fixes #18049. git-svn-id: http://svn.automattic.com/wordpress/trunk@18563 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/theme.php | 1 + wp-includes/class-wp-admin-bar.php | 2 ++ 2 files changed, 3 insertions(+) diff --git a/wp-admin/includes/theme.php b/wp-admin/includes/theme.php index 1600aa70b..f645d4408 100644 --- a/wp-admin/includes/theme.php +++ b/wp-admin/includes/theme.php @@ -20,6 +20,7 @@ function current_theme_info() { delete_option( 'current_theme' ); $current_theme = get_current_theme(); } + $ct = new stdClass; $ct->name = $current_theme; $ct->title = $themes[$current_theme]['Title']; $ct->version = $themes[$current_theme]['Version']; diff --git a/wp-includes/class-wp-admin-bar.php b/wp-includes/class-wp-admin-bar.php index af5a25c9c..02156c1b3 100644 --- a/wp-includes/class-wp-admin-bar.php +++ b/wp-includes/class-wp-admin-bar.php @@ -164,6 +164,8 @@ class WP_Admin_Bar { function add_node( $parent_id, &$menu, $child ) { foreach( $menu as $id => $menu_item ) { if ( $parent_id == $id ) { + if ( ! isset( $menu->{$parent_id}['children'] ) ) + $menu->{$parent_id}['children'] = new stdClass; $menu->{$parent_id}['children']->{$child['id']} = $child; $child = null; return true;