#32619 closed task (blessed) (fixed)
Introduce WP_Comment
Reported by: | wonderboymusic | Owned by: | wonderboymusic |
---|---|---|---|
Milestone: | 4.4 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Comments | Keywords: | has-patch |
Focuses: | Cc: |
Description
Modeling is a thing. WP_Comment
can do for comments what WP_Post
does for posts.
Attachments (8)
Change History (31)
#2
in reply to:
↑ 1
@
10 years ago
Replying to TimothyBlynJacobs:
Is there a reason the class is marked as
final
and followsWP_Post
rather thanWP_User
which is much more extensible?
Same reason as in comment:3:ticket:24672, I guess.
#5
@
10 years ago
As discussed over Twitter with @wonderboymusic, I actually wrote this patch in June of 2014, and I still have it, so I'm going to compare them to see if either of us missed anything. Before committing [32769], I resolved to figure this out. (It was also on my hit list for 4.3.)
#6
@
10 years ago
(I didn't do metadata support on purpose, but I'll have to think about why a bit more. Probably because I think it's a bit weird.)
#8
@
10 years ago
- Owner set to nacin
- Status changed from new to assigned
- Type changed from enhancement to task (blessed)
@nacin will take care of this
#9
@
10 years ago
- Milestone changed from 4.3 to Future Release
I think this is too late for 4.3 at this point. We've already done beta2 and this hasn't had any traction for a few weeks.
This ticket was mentioned in Slack in #core by rachelbaker. View the logs.
9 years ago
#12
@
9 years ago
- Keywords commit added
32619.2.diff refreshes my patch after violent amounts of churn. All unit tests still pass.
Comments are garbage and are begging for this
#13
@
9 years ago
- Keywords commit removed
- Owner changed from nacin to DrewAPicture
- Status changed from assigned to reviewing
We need to do a little bit of docs work here before this would be ready for commit.
I'd also probably recommend committing the class separately from the various function changes just so there's a clean break between introducing the class and integrating it.
#14
@
9 years ago
- Keywords commit added
- Owner changed from DrewAPicture to wonderboymusic
32619.3.diff shores up the docs for WP_Comment
:
- Adds a file header to class-wp-comment.php
- Adjusts the class DocBlock summary to better describe the purpose of the class rather than focus on what it is
- Added property descriptions,
@since
versions,@access
tags - Changed the type on
$comment_author
tostring
fromint
for the author name - Adds legit summaries to all methods, also filled out the DocBlocks with meaningful information
#17
in reply to:
↑ 16
@
9 years ago
Replying to DrewAPicture:
It's important for new functionality, especially something as significant as a new class to have complete documentation upon initial commit – not after the fact.
Let's be wary of resurrecting this bad habit. Providing docs on initial commit is full of virtue. We are sufficiently stockpiled on do-it-laters. ;-)
#18
in reply to:
↑ 15
@
9 years ago
Replying to wonderboymusic:
You made mistake in wp-includes/feed.php
. I've just reverted changes and changed object
to WP_Comment
.
Although I think that documentation for get_comment()
parameter and these functions that use it should be refreshed and synced.
#20
follow-up:
↓ 21
@
9 years ago
- Keywords commit removed
- Resolution fixed deleted
- Status changed from closed to reopened
[33891] has changed get_avatar_data()
to only support a WP_Comment
object and no longer a raw comment object from the database, trunk/src/wp-includes/link-template.php@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 32619.6.patch.
#21
in reply to:
↑ 20
@
9 years ago
Replying to ocean90:
[33891] has changed
get_avatar_data()
to only support aWP_Comment
object and no longer a raw comment object from the database, trunk/src/wp-includes/link-template.php@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 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 32619.patch
Oh god, yes please. Currently working on a project where this would be very helpful. Is there a reason the class is marked as
final
and followsWP_Post
rather thanWP_User
which is much more extensible?