Make WordPress Core

Changeset 61997


Ignore:
Timestamp:
03/12/2026 09:04:06 PM (2 months ago)
Author:
westonruter
Message:

Toolbar: Prevent PHP deprecation warning in admin bar when node is added with a null parent.

Developed in https://github.com/WordPress/wordpress-develop/pull/11055

Props sky_76, westonruter, ozgursar, sabernhardt.
Fixes #64728.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-admin-bar.php

    r61912 r61997  
    170170        );
    171171
    172         if ( isset( $back_compat_parents[ $args['parent'] ] ) ) {
     172        if ( is_string( $args['parent'] ) && isset( $back_compat_parents[ $args['parent'] ] ) ) {
    173173            list( $new_parent, $version ) = $back_compat_parents[ $args['parent'] ];
    174174            _deprecated_argument( __METHOD__, $version, sprintf( 'Use <code>%s</code> as the parent for the <code>%s</code> admin bar node instead of <code>%s</code>.', $new_parent, $args['id'], $args['parent'] ) );
Note: See TracChangeset for help on using the changeset viewer.