Make WordPress Core

Ticket #19371: 19371b.diff

File 19371b.diff, 475 bytes (added by willshouse, 13 years ago)

need to check for empty when removing in case the menu id does not exist

  • class-wp-admin-bar.

    old new  
    120120        }
    121121
    122122        public function remove_node( $id ) {
    123                 $node = $this->nodes[ $id ];
    124                 unset( $this->nodes[ $id ] );
    125                 return get_object_vars( $node );
     123                if(!empty($this->nodes[ $id ])){
     124                        $node = $this->nodes[ $id ];
     125                        unset( $this->nodes[ $id ] );
     126                        return get_object_vars( $node );
     127                }
    126128        }
    127129
    128130        public function render() {