Skip to content

RTC: Enable custom-fields support for linked entities to persist CRDT…#78986

Draft
Mustafabharmal wants to merge 1 commit into
WordPress:trunkfrom
Mustafabharmal:fix/rtc-sync-linked-entities
Draft

RTC: Enable custom-fields support for linked entities to persist CRDT…#78986
Mustafabharmal wants to merge 1 commit into
WordPress:trunkfrom
Mustafabharmal:fix/rtc-sync-linked-entities

Conversation

@Mustafabharmal
Copy link
Copy Markdown
Contributor

@Mustafabharmal Mustafabharmal commented Jun 5, 2026

What?

Closes #78966
Closes #76784

Fix real-time collaboration syncing and persistence for linked entities such as Navigation menus, Templates, Template Parts, and Global Styles.

When collaboration is enabled, changes made to these entities are not reliably persisted and can be reverted after reloading the editor. In collaborative sessions, updates may also fail to sync correctly between users.

Why?

The RTC implementation persists document state in the _crdt_document post meta field.

However, the linked entity post types (wp_navigation, wp_template, wp_template_part, and wp_global_styles) do not support custom-fields by default. Because of this, the REST API silently ignores attempts to save the _crdt_document meta field.

As a result:

  • CRDT documents are not persisted for these entities.
  • Reloading the editor can restore stale state.
  • Changes to linked entities may not sync correctly between collaborators.

How?

Add custom-fields support for the linked entity post types when collaboration is enabled so that the _crdt_document meta field can be persisted through the REST API.

This allows RTC document state to be stored and restored consistently for:

  • wp_navigation
  • wp_template
  • wp_template_part
  • wp_global_styles

Testing Instructions

  1. Insert a navigation block into a draft post
  2. Make some changes (e.g. add some links to the nav block)
  3. Save changes
  4. Reload the post
  5. Verify the changes persist and are not reverted.

Screenshots or screencast

Before After

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant