[wp-trac] [WordPress Trac] #36946: Provide `id` properties on core objects

WordPress Trac noreply at wordpress.org
Fri May 27 03:43:28 UTC 2016


#36946: Provide `id` properties on core objects
--------------------------+-----------------------------
 Reporter:  jeremyfelt    |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Future Release
Component:  General       |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:
--------------------------+-----------------------------

Comment (by rmccue):

 Replying to [comment:2 jeremyfelt]:
 > Also worth noting that the WP REST API team is using `id` in responses
 for core objects.

 We switched away from uppercase `ID` because it's inconsistent with every
 other field. We have properties like `display_name`, `post_title`, etc,
 but `ID` doesn't match this. It looks especially weird when you have
 things like `site_ID`. Plus: every other abbreviation is lowercase, except
 for `ID`. Under the current system, you could end up with `http_url_ID`,
 which makes 0 sense.

 While @DrewAPicture is correct that "ID" is the correct casing for the
 English abbreviation, we're not using regular English sentences, we're
 using snake_case, which is all lowercase.

 Replying to [comment:6 jb510]:
 > Is it worth discussing function and hook names at the same time?
 get_the_ID(), the_ID(), get_author_user_ids, get_current_blog_id().

 PHP function names are case-insensitive, so I think it makes sense to re-
 case all these at the same time, since it won't break anything. Docs are
 the main thing that will need updating.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/36946#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list