Make WordPress Core


Ignore:
Timestamp:
11/03/2019 10:12:32 PM (5 years ago)
Author:
whyisjake
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/adminbar.php

    r46586 r46642  
    347347
    348348    /**
     349     * @ticket 19647
     350     */
     351    public function test_deprecated_menu_methods() {
     352        $admin_bar = new WP_Admin_Bar();
     353        $node_data = array( 'id' => 'test-node-19647' );
     354
     355        // Test add_menu() deprecation.
     356        $this->setExpectedDeprecated( 'WP_Admin_Bar::add_menu' );
     357        $admin_bar->add_menu( $node_data );
     358        $node_test = $admin_bar->get_node( 'test-node-19647' );
     359        $this->assertNotNull( $node_test );
     360
     361        // Test remove_menu() deprecation.
     362        $this->setExpectedDeprecated( 'WP_Admin_Bar::remove_menu' );
     363        $admin_bar->remove_menu( 'test-node-19647' );
     364        $node_test = $admin_bar->get_node( 'test-node-19647' );
     365        $this->assertNull( $node_test );
     366    }
     367
     368    /**
    349369     * @ticket 22247
    350370     */
Note: See TracChangeset for help on using the changeset viewer.