Skip to content

Conversation

adamsilverstein
Copy link
Member

@adamsilverstein adamsilverstein commented Sep 22, 2025

Trac ticket:


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

We can introduce this in GB using allow_empty_comment

Copy link

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • The Plugin and Theme Directories cannot be accessed within Playground.
  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@adamsilverstein
Copy link
Member Author

Thanks for reviewing @dream-encode! We will start with a matching Trac ticket then I can get it committed.

@adamsilverstein
Copy link
Member Author

cc: @TimothyBJacobs for review

@adamsilverstein adamsilverstein marked this pull request as ready for review September 22, 2025 14:21
Copy link

github-actions bot commented Sep 22, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props adamsilverstein, davidbaumwald, kadamwhite.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@adamsilverstein
Copy link
Member Author

Looking at this again I see we already do an empty content check in check_is_comment_content_allowed and allow bypassing with a filter:

/** This filter is documented in wp-includes/comment.php */
$allow_empty = apply_filters( 'allow_empty_comment', false, $check );
if ( $allow_empty ) {
return true;
}
/*
* Do not allow a comment to be created with missing or empty
* comment_content. See wp_handle_comment_submission().
*/
return '' !== $check['comment_content'];

Maybe we can just remove the additional check here? That way Gutenberg can bypass the check for its specific types using the allow_empty_comment filter.

@kadamwhite
Copy link
Contributor

@TimothyBJacobs I'm looking at the history here on how core's handled empty comments historically, and can make the trac ticket Adam's asked for

@adamsilverstein
Copy link
Member Author

Closing this for now, will revisit once we have a Trac ticket and direction in the Gutenberg plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants