WordPress.org

Make WordPress Core

Ticket #47678: 47678-WP_Admin_Bar-add_node.patch

File 47678-WP_Admin_Bar-add_node.patch, 1.0 KB (added by jrf, 11 months ago)

WP_Admin_Bar::add_node(): Remove redundant calls to func_get_arg()

  • src/wp-includes/class-wp-admin-bar.php

    From c41a11cbe6f38c57a0887b8d8d9693ec6a99a2db Mon Sep 17 00:00:00 2001
    From: jrfnl <jrfnl@users.noreply.github.com>
    Date: Fri, 19 Jul 2019 20:44:43 +0200
    Subject: [PATCH] WP_Admin_Bar::add_node(): Remove redundant calls to
     `func_get_arg()`
    
    ---
     src/wp-includes/class-wp-admin-bar.php | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/src/wp-includes/class-wp-admin-bar.php b/src/wp-includes/class-wp-admin-bar.php
    index 38e76e3bff..14ae515c97 100644
    a b class WP_Admin_Bar { 
    115115         */
    116116        public function add_node( $args ) {
    117117                // Shim for old method signature: add_node( $parent_id, $menu_obj, $args )
    118                 if ( func_num_args() >= 3 && is_string( func_get_arg( 0 ) ) ) {
    119                         $args = array_merge( array( 'parent' => func_get_arg( 0 ) ), func_get_arg( 2 ) );
     118                if ( func_num_args() >= 3 && is_string( $args ) ) {
     119                        $args = array_merge( array( 'parent' => $args ), func_get_arg( 2 ) );
    120120                }
    121121
    122122                if ( is_object( $args ) ) {