distributor
distributor copied to clipboard
Fix: Delay `send_notifications` until after all meta has saved
Description of the Change
Use wp_insert_post instead of save_post to update syndicated posts. wp_insert_post is the last action when updating a post, use it will ensure distributor update remote posts after all meta is saved.
Alternate Designs
Benefits
Possible Drawbacks
Verification Process
Check with Yoast SEO as describe in #399
Checklist:
- [x] I have read the CONTRIBUTING document.
- [x] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] I have added tests to cover my change.
- [ ] All new and existing tests passed.
Applicable Issues
Closes #399
Changelog Entry
Given that we're aiming to cover larger structural changes for Distributor in an upcoming release, it may make more sense to tandem this PR and related issue then.
I'm going to close this off as all of the files it touches are conflicted and with the new minimum requirement bumps it's possible to do this consistently for both the Gutenberg (REST) and classic updates.