RTC: Add filter for plugins to register additional synced post properties#75876
RTC: Add filter for plugins to register additional synced post properties#75876smithjw1 wants to merge 1 commit intoWordPress:trunkfrom
Conversation
…ties Adds a `crdt.additionalPostProperties` filter so plugins can register custom taxonomy rest_base values or other post properties for real-time collaboration sync. The filter is additive-only — default properties cannot be removed, preventing plugins from accidentally breaking collaborative editing. Closes WordPress#75875 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @smithjw1! In case you missed it, we'd love to have you join us in our Slack community. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
|
How are these fields registered against the |
|
For Co-authors Plus they are registered here:
I haven't been able to find a way to get this taxonomy to reliably sync without adding placeholder meta. |
7eaf01b to
d38799e
Compare
|
Closing in favor of #75983 |
Summary
crdt.additionalPostPropertiesfilter so plugins can register custom post properties for real-time collaboration sync (additive-only — default properties cannot be removed)rest_basevalues for CRDT sync when taxonomy entities are loaded from the REST API, so plugins withshow_in_resttaxonomies work with RTC out of the box@wordpress/hooksas a dependency to@wordpress/core-dataThis means plugins like Co-Authors Plus (which uses a custom taxonomy) no longer need to set redundant meta to participate in real-time collaboration — their taxonomy is auto-synced.
Security
/wp/v2/taxonomiesare registered (these already haveshow_in_rest: true)assign_termscapabilities server-side on savewp:action-assign-{rest_base}link relations before rendering term controlsnumber[]arrays, handled by the existing default code path (same ascategories/tags)Closes #75875
Test plan
npm run test:unit -- --testPathPattern="packages/core-data/src/utils/test/crdt"registerTaxonomyRestBases(dynamically registered taxonomy properties sync in both directions)show_in_rest: trueauto-syncs between collaborators without any plugin-side filter registrationcrdt.additionalPostPropertiesfilter still works for non-taxonomy properties🤖 Generated with Claude Code