From a216b6d83845dc4cdd01ff517cdf36b72043b6b3 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Fri, 8 Nov 2019 13:17:35 +0000 Subject: [PATCH] Toolbar: Un-deprecate the `WP_Admin_Bar::add_menu()` method. This is only a wrapper for the `add_node()` method, but it's in widespread use both in core until [46642] and in thousands of plugins and themes. Deprecating it would have made sense when #19647 was originally opened but that's no longer the case. Props whyisjake Fixes #19647 git-svn-id: https://develop.svn.wordpress.org/trunk@46678 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-admin-bar.php | 2 -- tests/phpunit/tests/adminbar.php | 20 -------------------- 2 files changed, 22 deletions(-) diff --git a/src/wp-includes/class-wp-admin-bar.php b/src/wp-includes/class-wp-admin-bar.php index 2a137e746e..ce1464e125 100644 --- a/src/wp-includes/class-wp-admin-bar.php +++ b/src/wp-includes/class-wp-admin-bar.php @@ -90,7 +90,6 @@ class WP_Admin_Bar { * @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 ); } @@ -103,7 +102,6 @@ class WP_Admin_Bar { * @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 ); } diff --git a/tests/phpunit/tests/adminbar.php b/tests/phpunit/tests/adminbar.php index 600dfca83e..a9a2ed4564 100644 --- a/tests/phpunit/tests/adminbar.php +++ b/tests/phpunit/tests/adminbar.php @@ -345,26 +345,6 @@ class Tests_AdminBar extends WP_UnitTestCase { ); } - /** - * @ticket 19647 - */ - public function test_deprecated_menu_methods() { - $admin_bar = new WP_Admin_Bar(); - $node_data = array( 'id' => 'test-node-19647' ); - - // Test add_menu() deprecation. - $this->setExpectedDeprecated( 'WP_Admin_Bar::add_menu' ); - $admin_bar->add_menu( $node_data ); - $node_test = $admin_bar->get_node( 'test-node-19647' ); - $this->assertNotNull( $node_test ); - - // Test remove_menu() deprecation. - $this->setExpectedDeprecated( 'WP_Admin_Bar::remove_menu' ); - $admin_bar->remove_menu( 'test-node-19647' ); - $node_test = $admin_bar->get_node( 'test-node-19647' ); - $this->assertNull( $node_test ); - } - /** * @ticket 22247 */