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

WordPress Trac noreply at wordpress.org
Thu May 26 00:22:41 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        |   Keywords:  needs-patch
  Focuses:                |
 In #36717, `WP_Site` and `WP_Network` will get magic getters/setters so
 that `id` and other more properly named properties can be used.

 We should standardize on `id` rather than `ID` for core objects where it
 makes sense.

 Current primary IDs for objects are:

 * `WP_Comment` -> `comment_ID`
 * `WP_Post` -> `ID`
 * `WP_Term` -> `term_id`
 * `WP_User` -> `ID`
 * `WP_Widget` -> `id`
 * `WP_Screen` -> `id`

 `WP_User` is somewhat unique because the property was `id` and then
 deprecated in [18504] in favor of `ID`. We should be able to un-deprecate

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

More information about the wp-trac mailing list