Toolbar: Use add_node() instead of add_menu() in core.

This patch replaces all references to the add_menu() method with the add_node() one. (Also some code structure modifications for wp_admin_bar_appearance_menu().)

Fixes: #19647
Props: linuxologos, paulschreiber, morganestes, akibjorklund, nacin, whyisjake.

Built from https://develop.svn.wordpress.org/trunk@46642


git-svn-id: http://core.svn.wordpress.org/trunk@46442 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
whyisjake
2019-11-03 22:14:01 +00:00
parent 946217dcca
commit 5e7876622e
3 changed files with 64 additions and 52 deletions

View File

@@ -82,16 +82,28 @@ class WP_Admin_Bar {
}
/**
* @param array $node
* Add a node (menu item) to the Admin Bar menu.
*
* @since 3.3.0
* @since 5.4.0 Deprecated in favor of {@see WP_Admin_Bar::add_node()}.
*
* @param array $node The attributes that define the node.
*/
public function add_menu( $node ) {
_deprecated_function( __METHOD__, '5.4.0', __CLASS__ . '::add_node()' );
$this->add_node( $node );
}
/**
* @param string $id
* Remove a node from the admin bar.
*
* @since 3.1.0
* @since 5.4.0 Deprecated in favor of {@see WP_Admin_Bar::remove_node()}.
*
* @param string $id The menu slug to remove.
*/
public function remove_menu( $id ) {
_deprecated_function( __METHOD__, '5.4.0', __CLASS__ . '::remove_node()' );
$this->remove_node( $id );
}