[wp-trac] [WordPress Trac] #13937: Pass list of arguments as array in add_meta_box()

WordPress Trac wp-trac at lists.automattic.com
Sun Jun 20 21:26:10 UTC 2010


#13937: Pass list of arguments as array in add_meta_box()
--------------------------+-------------------------------------------------
 Reporter:  scribu        |       Owner:           
     Type:  defect (bug)  |      Status:  new      
 Priority:  normal        |   Milestone:  3.1      
Component:  General       |     Version:           
 Severity:  minor         |    Keywords:  has-patch
--------------------------+-------------------------------------------------

Comment(by johnbillion):

 Replying to [comment:4 scribu]:
 > @johnbillion: thanks for the suggestion. I abstracted a smaller portion,
 to keep it more flexible. See add_meta_box.2.diff
 Nice one. Pedantic improvement if this goes in: no need for
 `func_num_args` and `func_get_args` to be assigned to variables (as
 they're only used once each), they can be used in place.

 Maybe another ticket can be opened to identify other candidate functions
 for this treatment. I know it was brought up on wp-hackers a while ago.
 Certainly functions where more than half the parameters are optional would
 benefit from working like this.

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


More information about the wp-trac mailing list