Make WordPress Core

Changes between Version 2 and Version 5 of Ticket #64049


Ignore:
Timestamp:
09/29/2025 09:11:05 PM (7 months ago)
Author:
kadamwhite
Comment:

@TimothyBlynJacobs @ryan I've refreshed @adamsilverstein's patch here and added a test to validate that content updates respect the filter value. Thoughts?

This was proposed as part of the block editor commenting initiative, but to me it feels like a good inconsistency to fix regardless of the ongoing work on that feature.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #64049 – Description

    v2 v5  
    11When updating a comment via the REST API we currently fail comment updates in the `WP_REST_Comments_Controller::update_item` method if the updated content is `empty()`. On REST comment creation and within traditional comment updates via `wp_handle_comment_submission` we respect the return value of the `allow_empty_comment` filter and permit empty comment content when this filter is set.
    22
    3 My understanding of the history here (see #62684) is that allowing comments to be edited to become empty permits moderation by allowing inappropriate comment content to be deleted without removing the content entity itself; or alternatively (and as discussed in #43177) to permit comments to be saved which only contain metadata and do not have any "content" in the traditional sense.
     3My understanding of the history here is that allowing empty comments permits moderation by allowing inappropriate comment content to be deleted without removing the content entity itself; or alternatively (and as discussed in #43177) to permit comments to be saved which only contain metadata and do not have any "content" in the traditional sense.
    44
    55This may also unblock certain actions for editorial comments within the block editor.