Make WordPress Core


Ignore:
Timestamp:
11/03/2019 10:12:32 PM (4 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/src/wp-includes/class-wp-admin-bar.php

    r46140 r46642  
    8383
    8484    /**
    85      * @param array $node
     85     * Add a node (menu item) to the Admin Bar menu.
     86     *
     87     * @since 3.3.0
     88     * @since 5.4.0 Deprecated in favor of {@see WP_Admin_Bar::add_node()}.
     89     *
     90     * @param array $node The attributes that define the node.
    8691     */
    8792    public function add_menu( $node ) {
     93        _deprecated_function( __METHOD__, '5.4.0', __CLASS__ . '::add_node()' );
    8894        $this->add_node( $node );
    8995    }
    9096
    9197    /**
    92      * @param string $id
     98     * Remove a node from the admin bar.
     99     *
     100     * @since 3.1.0
     101     * @since 5.4.0 Deprecated in favor of {@see WP_Admin_Bar::remove_node()}.
     102     *
     103     * @param string $id The menu slug to remove.
    93104     */
    94105    public function remove_menu( $id ) {
     106        _deprecated_function( __METHOD__, '5.4.0', __CLASS__ . '::remove_node()' );
    95107        $this->remove_node( $id );
    96108    }
Note: See TracChangeset for help on using the changeset viewer.