[wp-trac] [WordPress Trac] #32619: Introduce WP_Comment
WordPress Trac
noreply at wordpress.org
Mon Sep 14 20:02:33 UTC 2015
#32619: Introduce WP_Comment
----------------------------+-----------------------------
Reporter: wonderboymusic | Owner: wonderboymusic
Type: task (blessed) | Status: reopened
Priority: normal | Milestone: 4.4
Component: Comments | Version:
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
----------------------------+-----------------------------
Comment (by DrewAPicture):
Replying to [comment:20 ocean90]:
> [33891] has changed `get_avatar_data()` to only support a `WP_Comment`
object and no longer a raw comment object from the database,
[source:trunk/src/wp-includes/link-template.php at 33891#L3620].
> This broke the recent comment widget in P2,
https://themes.trac.wordpress.org/browser/p2/1.5.5/inc/widgets/recent-
comments.php#L143.
>
> I think we should continue to support both, see
[attachment:32619.6.patch].
Wouldn't it be better to normalize the object as a `WP_Comment` instance
instead of essentially promoting the edge case by checking for a general
object alongside the `instanceof`?
I'd argue that in introducing `WP_Comment` we'd want to encourage a single
pathway going forward wherever possible. See [attachment:32619.patch]
--
Ticket URL: <https://core.trac.wordpress.org/ticket/32619#comment:21>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list