Opened 9 years ago
Closed 8 years ago
#36784 closed enhancement (fixed)
wp_update_comment should work with meta
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.9 | Priority: | normal |
Severity: | normal | Version: | 4.4 |
Component: | Comments | Keywords: | has-patch early has-unit-tests |
Focuses: | Cc: |
Description
Since 4.4, wp_insert_comment allows you to pass through meta that will be added to the new comment...
// If metadata is provided, store it. if ( isset( $commentdata['comment_meta'] ) && is_array( $commentdata['comment_meta'] ) ) { foreach ( $commentdata['comment_meta'] as $meta_key => $meta_value ) { add_comment_meta( $comment->comment_ID, $meta_key, $meta_value, true ); } }
I have found this very useful in simplifying my new comment construction.
Suggesting the same code be added to wp_update_comment, except using update_comment_meta, to mirror the functionality.
Attachments (5)
Change History (28)
This ticket was mentioned in Slack in #core-comments by dshanske. View the logs.
9 years ago
#2
@
9 years ago
- Keywords has-patch early added
- Milestone changed from Awaiting Review to Future Release
#4
@
9 years ago
36784.4.diff refreshes 36784.3.diff with the following:
- Remove unnecessary changes to whitespace in
$keys
array - Improve code formatting and remove excess whitespace in test
I think we also need a @since
annotation for this, too. See https://make.wordpress.org/core/handbook/best-practices/inline-documentation-standards/php/#since-section-changelogs
Functionality and test look pretty good. Let's do this for 4.7.
This ticket was mentioned in Slack in #core-comments by dshanske. View the logs.
9 years ago
This ticket was mentioned in Slack in #core by helen. View the logs.
8 years ago
#9
@
8 years ago
- Milestone changed from Future Release to 4.7
Sounds like patch needs an update but otherwise milestoning so it doesn't get lost.
#10
@
8 years ago
@rachelbaker @boonebgorges Still hope to do this for 4.7? What remains to be done?
This ticket was mentioned in Slack in #core by chriscct7. View the logs.
8 years ago
#12
@
8 years ago
- Keywords 4.7-early removed
- Milestone changed from 4.7 to Future Release
We missed the early part of the 4.7 release cycle, so I am punting out of the 4.7 milestone. If this ticket does start picking up momentum we can move it back.
This ticket was mentioned in Slack in #core by dshanske. View the logs.
8 years ago
#15
@
8 years ago
Wanted to update the notation on the ticket. @rachelbaker clarified it is a change in functionality to a common function and may bring up unexpected edge cases.
Will bring this up for 4.8-early later on.
This ticket was mentioned in Slack in #core by jeffpaul. View the logs.
8 years ago
This ticket was mentioned in Slack in #core by jeffpaul. View the logs.
8 years ago
#19
@
8 years ago
- Milestone changed from 4.8 to Future Release
Punted to Future Release, since this missed the first Beta of 4.8.
#20
@
8 years ago
Considering this was tagged originally for 4.7-early...how can I prevent it from being punted again?
#21
@
8 years ago
- Milestone changed from Future Release to 4.9
To my knowledge, other than the concern re behavior, nothing needs to be done. Tests are included, @boonebgorges made modifications to my original patch.
Didn't look closely.