[wp-trac] [WordPress Trac] #35404: Incorrect @var docs for WP_Network property types

WordPress Trac noreply at wordpress.org
Mon Jan 18 02:47:40 UTC 2016


#35404: Incorrect @var docs for WP_Network property types
--------------------------------+------------------------------
 Reporter:  jdgrimes            |       Owner:
     Type:  defect (bug)        |      Status:  new
 Priority:  normal              |   Milestone:  4.5
Component:  Networks and Sites  |     Version:  4.4
 Severity:  normal              |  Resolution:
 Keywords:                      |     Focuses:  docs, multisite
--------------------------------+------------------------------
Changes (by jeremyfelt):

 * milestone:  Awaiting Review => 4.5


Comment:

 Good catches. `$cookie_domain` is the easy one, we can change that to
 `string` with no issue.

 I think we're left with changing the docs for `$blog_id` and `$id` to
 `string`. As mentioned, this object has existed in this format as
 `$current_site` for a long time.

 I'm not sure that strict comparisons for these properties are a good idea
 in general, as custom implementations may have been doing all sorts of
 things in the past. It would be interesting to look into what breakage
 might occur if we did start casting things to integers, especially as
 we're getting better at clarifying some of this.

 In the `WP_Post` docs, we note `A numeric string, for compatibility
 reasons.` for `$post_author` and `$comment_count`. We should probably do
 the same here. We're able to provide an `int` `$ID` property there because
 it was sanitized as such long before `WP_Post` was introduced. We do still
 assign a default value of `0` for these strings. I don't see any harm in
 that at the moment, as

 It also looks like we have the same doc mismatches in `WP_Comment` for
 `$comment_ID` and `$comment_post_ID`.

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


More information about the wp-trac mailing list