-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Incorporating foundation of "Notes" feature #10280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
004f7fb to
e08eea2
Compare
src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php
Outdated
Show resolved
Hide resolved
|
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 ); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
48d0ba7 to
b351ddb
Compare
Test using WordPress PlaygroundThe 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
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
|
@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? |
|
@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:
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. |
|
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. |
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: