Skip to content

Conversation

@t-hamano
Copy link
Contributor

@t-hamano t-hamano commented Oct 15, 2025

This PR updates the core codebase to allow the Notes feature to work properly.

Trac ticket: https://core.trac.wordpress.org/ticket/64096

Note

This PR also includes #9869. Don't forget to add the following prop when committing to core:

Props ristojovanovic, adamsilverstein, jeffpaul.

@t-hamano t-hamano force-pushed the 64096-notes-backport branch from 004f7fb to e08eea2 Compare October 15, 2025 07:35
@t-hamano t-hamano changed the title Notes: Update comments rest API Incorporating foundation of "Notes" feature Oct 15, 2025
@t-hamano
Copy link
Contributor Author

Ok, I believe backporting PHP should be all done. Next, I'll try to fix the failing tests.

@Mamaduka
Copy link
Member

Ok, I believe backporting PHP should be all done. Next, I'll try to fix the failing tests.

I think we're missing the Notes-specific unit tests.

$post_id_in = "'" . implode( "', '", $post_id_array ) . "'";

$pending = $wpdb->get_results( "SELECT comment_post_ID, COUNT(comment_ID) as num_comments FROM $wpdb->comments WHERE comment_post_ID IN ( $post_id_in ) AND comment_approved = '0' GROUP BY comment_post_ID", ARRAY_A );
$pending = $wpdb->get_results( "SELECT comment_post_ID, COUNT(comment_ID) as num_comments FROM $wpdb->comments WHERE comment_post_ID IN ( $post_id_in ) AND comment_approved = '0' AND comment_type != 'note' GROUP BY comment_post_ID", ARRAY_A );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's another PR for get_pending_comments_num changes - #9869.

Just noting for props.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a fan of hardcoding comment types. Long term we should think about using a filterable list of comment types to exclude or using (an improved) WP_Comment_Query

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

100%. I think a long-term solution is to provide proper support for custom comment types, so we can avoid hardcoded patches like we've introduced with the current implementation.

@t-hamano t-hamano force-pushed the 64096-notes-backport branch from 48d0ba7 to b351ddb Compare October 15, 2025 11:15
@github-actions
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.

@jeffpaul
Copy link
Member

@desrosj any idea why the Playground bot commented after the PR was closed versus after it was opened? Seems like it ideally triggers after a PR is opened so folks have an easy way to test, yeah?

@desrosj
Copy link
Member

desrosj commented Oct 31, 2025

@jeffpaul The workflow that leaves the Playground comment runs when the Test Build Process workflow completes (the results of the build process are zipped and uploaded to these runs).

Looking at the timeline of events on the PR, I think what happened was as follows:

  • 2ad2332 was merged into the HEAD branch.
  • ~10 minutes later, the commit to trunk was made and mirrored to this repository in c62fe7e.
  • The Test Build Process workflow was probably still running at this time, or had not started and was queued because of the log jam that happened leading up to beta 1.
  • The workflow finally finished and triggered the commenting workflow ~30 minutes later.

The commenting workflow does not currently check if the PR has been closed before posting. It just relies on the prerequisite workflow run completing. There is Core-61568 on Trac that is aimed at only sharing a Playground link when the changes are being made would actually be testable within a Playground instance. For example, GitHub Action workflow files cannot be tested in Playground. I am going to add this to a comment on that ticket so it does not get lost.

@t-hamano t-hamano deleted the 64096-notes-backport branch November 2, 2025 09:39
@WordPress WordPress deleted a comment Nov 2, 2025
@WordPress WordPress deleted a comment Nov 2, 2025
@WordPress WordPress deleted a comment Nov 2, 2025
@WordPress WordPress deleted a comment Nov 2, 2025
@WordPress WordPress deleted a comment Nov 3, 2025
@WordPress WordPress deleted a comment Nov 3, 2025
@WordPress WordPress deleted a comment Nov 3, 2025
@WordPress WordPress deleted a comment Nov 3, 2025
@WordPress WordPress deleted a comment Nov 3, 2025
@WordPress WordPress deleted a comment Nov 3, 2025
@WordPress WordPress deleted a comment Nov 3, 2025
@WordPress WordPress deleted a comment Nov 3, 2025
@WordPress WordPress deleted a comment Nov 3, 2025
@WordPress WordPress deleted a comment Nov 3, 2025
@WordPress WordPress deleted a comment Nov 3, 2025
@WordPress WordPress deleted a comment Nov 3, 2025
@WordPress WordPress deleted a comment Nov 3, 2025
@WordPress WordPress deleted a comment Nov 3, 2025
@WordPress WordPress deleted a comment Nov 3, 2025
@WordPress WordPress deleted a comment Nov 3, 2025
@desrosj
Copy link
Member

desrosj commented Nov 3, 2025

Despite being reported several times and continually deleting the content, this account continues to spam this PR. I am going to lock the conversation for this PR to avoid the massive amounts of noise until GH takes action on the account.

@WordPress WordPress locked as spam and limited conversation to collaborators Nov 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants