-
Notifications
You must be signed in to change notification settings - Fork 328
Delete Email Log posts on reset. #11797
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
Delete Email Log posts on reset. #11797
Conversation
|
Build files for ee78b37 have been deleted. |
zutigrm
left a comment
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.
LGTM
includes/Core/Util/Reset.php
Outdated
| } | ||
|
|
||
| foreach ( $sites as $site_id ) { | ||
| $prefix = $wpdb->get_blog_prefix( $site_id ); |
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.
Although, it looks logical to use direct SQL queries to delete these posts, but this is not how it should be done. We need to use wp_delete_post because it executes different actions that other plugins may use to clean up their data as well.
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.
Switched to wp_delete_post and I also added required pagination to bring it inline with the Cleanup worker.
…delete-cpt-on-reset.
…delete-cpt-on-reset.
Summary
Addresses issue:
Relevant technical choices
PR Author Checklist
Do not alter or remove anything below. The following sections will be managed by moderators only.
Code Reviewer Checklist
Merge Reviewer Checklist