Run NetworkSiteConnection::update_syndicated on correct hook when using Gutenberg #518
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the Change
Add a check to the
NetworkSiteConnection::update_syndicated
method to see if the current post is saved through Gutenberg. If so add a new action that runs the same method but on therest_after_insert_{$post_type}
hook to fix an issue where updates to terms/meta etc where not beeing syndicated.For a deeper discussion about what problems this is trying to solve see issue #464
Alternate Designs
Had some back-and-forth on the #464 issue, but this solution seemed like the most "elegant" to a problem without any ideal solutions.
Benefits
Terms/meta etc. will be syndicated when updating an already syndicated post, no matter if it's written using the classic editor, Gutenberg without legacy metaboxes or Gutenberg with legacy metaboxes.
Possible Drawbacks
Maybe if WP changed how the legacy metaboxes are saved this would need to be reworked, but I'm having a hard time seeing them change that functionality.
Verification Process
Tested this with the classic editor and Gutenberg with and without legacy metaboxes and terms/meta etc are all syndicated correctly when updating a post. See #464 for more details on the bug and how to trigger it.
Checklist:
Applicable Issues
Fixes #464