[wp-trac] [WordPress Trac] #8779: Standardize get_*, add_*, delete_*, and update_* function names

WordPress Trac wp-trac at lists.automattic.com
Thu Jan 1 23:34:17 GMT 2009


#8779: Standardize get_*, add_*, delete_*, and update_* function names
--------------------------+-------------------------------------------------
 Reporter:  filosofo      |       Owner:  anonymous                            
     Type:  defect (bug)  |      Status:  new                                  
 Priority:  normal        |   Milestone:  2.8                                  
Component:  General       |     Version:  2.8                                  
 Severity:  normal        |    Keywords:  deprecated has-patch functions naming
--------------------------+-------------------------------------------------
 Of the approximately 500 or so functions like get_*, add_*, delete_*, and
 update_*, all except about 20 follow the format of separating each word
 with underscores, like so: {{{get_attached_file}}} (as opposed to
 {{{get_attachedfile}}}).

 Those 20 that don't make things confusing and should be deprecated.  This
 has already happened to some degree (take a look at the existing functions
 in wp-includes/deprecated.php).

 This is not just a pedantic fix.  Is it {{{get_user_meta}}} or
 {{{get_usermeta}}}, {{{get_post_meta}}} or {{{get_postmeta}}}?  (One uses
 underscores, the other doesn't.  I have to look up which is which almost
 every time I use them, and that's a lot).

 To make things more confusing, we have similar-yet-inconsistently-named
 functions such as {{{update_post_meta}}} and {{{update_postmeta_cache}}}.

 Someone may object that some of these are too much a part of !WordPress to
 be changed. Not to worry--they can sit in deprecated.php for a long time,
 if you want.  Besides, it won't be the first time that well-used functions
 have been deprecated ({{{get_postdata}}} and the {{{user_can*}}}
 functions, for example).

 So please, let's deprecate these while it's early in 2.8 development.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/8779>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list