[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
Wed Nov 30 18:41:16 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:  accepted
 Priority:  normal                  |   Milestone:  3.3
Component:  Admin Bar               |     Version:  3.3
 Severity:  minor                   |  Resolution:
 Keywords:  has-patch dev-feedback  |
------------------------------------+-----------------------

Comment (by nacin):

 This is going to take too long to get right.

 I suggest:

 public function recursive_render() calls _render_item()

 public function render() calls _bind() and _render()

 protected function _bind() binds the items.

 protected function _render() calls final protected functions
 _render_item() and _render_group()

 We leave the namespaces render_item() and render_group() open. Ideally,
 these will become overridable in the future.

 If you were already overriding render() and recursive_render(), things
 will work fine. If you were completely replacing WP_Admin_Bar (subclassing
 is not a requirement, for better or worse), things will work fine.

 We could choose to not finalize _render_item() and _render_group(). Some
 code in _render_group() will need to be moved to _bind().

 Finally, one thing the existing patches do not touch, is making sure that
 $this->menu returns back compat code. This should not be exceedingly
 difficult.

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


More information about the wp-trac mailing list