[wp-trac] [WordPress Trac] #18179: WP_Meta_Box

WordPress Trac wp-trac at lists.automattic.com
Wed Jul 20 13:15:51 UTC 2011


#18179: WP_Meta_Box
----------------------------+------------------
 Reporter:  koopersmith     |       Owner:
     Type:  task (blessed)  |      Status:  new
 Priority:  normal          |   Milestone:  3.3
Component:  Administration  |     Version:
 Severity:  normal          |  Resolution:
 Keywords:  has-patch       |
----------------------------+------------------

Comment (by hakre):

 Just some feedback while quickly scanning over the code:

 `WP_Meta_Box::registry()->add( $this );` - takes object instance

 `WP_Meta_Box::registry()->remove( get_class( $this ), $this->screen,
 $this->slug );` - has a totally different parameter setup.

 It's easier if the correlating methods share the same parameter types and
 order.

 And if you store the object instances hashed (e.g. `spl_object_hash`)
 inside the registry, it will reduce the code in the remove part
 drastically because you always have the right instance to remove by it's
 hash.

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


More information about the wp-trac mailing list