[wp-trac] [WordPress Trac] #19371: As of 3.3beta2 WP_Admin_Bar no longer provides a way to access attributes of existing menu items

WordPress Trac wp-trac at lists.automattic.com
Thu Dec 1 20:38:27 UTC 2011


#19371: As of 3.3beta2 WP_Admin_Bar no longer provides a way to access attributes
of existing menu items
------------------------------+---------------------
 Reporter:  willshouse        |       Owner:  nacin
     Type:  defect (bug)      |      Status:  closed
 Priority:  high              |   Milestone:  3.3
Component:  Admin Bar         |     Version:  3.3
 Severity:  minor             |  Resolution:  fixed
 Keywords:  has-patch commit  |
------------------------------+---------------------

Comment (by nacin):

 Replying to [comment:29 willshouse]:
 > I think we should possibly change "`get_nodes`" to be a public function.
 If we don't change it to a public function, what is the proper method for
 removing all child items from a node?

 If I had to guess, orphaning them. But that's not a very good answer, I
 know. koopersmith, thoughts?

 > So can we either change "`get_nodes`" to a public function or can
 someone let me know the best way to remove all child items (and child
 "groups") ?
 >
 > ps: I think it would be OK if get_nodes was a public function. Since it
 is just pulling data it won't affect the internal storage.

 I could get behind that. It should be noted, though, that get_nodes()
 generally returns a flat list of nodes, but that it can also return a
 mixture of a tree and a flat list once bound. Once _bind() is called,
 $this->nodes gets poisoned pretty well. If we can make it so get_nodes()
 always returns a flat list of nodes that can later be bound into a tree, I
 think we're in good shape.

 For compat reasons, we may need to additionally unset( $args['children'] )
 in add_node(), and make _bind() able to run more than once to allow for a
 re-binding of all nodes.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19371#comment:30>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list