From a39bffbadb869281359807a50f0523a26e9d46d5 Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 6 Dec 2011 00:31:11 +0000 Subject: [PATCH] Add back compat support for my-account-with-avatar admin bar node id. fixes #19426 git-svn-id: http://svn.automattic.com/wordpress/trunk@19555 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-admin-bar.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/wp-includes/class-wp-admin-bar.php b/wp-includes/class-wp-admin-bar.php index 5eed3b4a01..7d4d9c962c 100644 --- a/wp-includes/class-wp-admin-bar.php +++ b/wp-includes/class-wp-admin-bar.php @@ -113,6 +113,17 @@ class WP_Admin_Bar { $args = wp_parse_args( $args, $defaults ); + $back_compat_parents = array( + 'my-account-with-avatar' => array( 'my-account', '3.3' ), + 'my-blogs' => array( 'my-sites', '3.3' ), + ); + + if ( isset( $back_compat_parents[ $args['parent'] ] ) ) { + list( $new_parent, $version ) = $back_compat_parents[ $args['parent'] ]; + _deprecated_argument( __METHOD__, $version, sprintf( 'Use %s as the parent for the %s admin bar node instead of %s.', new_parent, $args['id'], $args['parent'] ) ); + $args['parent'] = $new_parent; + } + $this->_set_node( $args ); }