Skip to content

Commit 45309c7

Browse files
committed
Real-time collaboration: fix comment syncing in site editor.
Developed in WordPress#10981. See also WordPress/gutenberg#75746. Props alecgeatches, czarate. See #64622. git-svn-id: https://develop.svn.wordpress.org/trunk@61704 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 0544d56 commit 45309c7

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/wp-includes/collaboration/class-wp-http-polling-sync-server.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,11 @@ private function can_user_sync_entity_type( string $entity_kind, string $entity_
278278
return isset( $taxonomy->cap->assign_terms ) && current_user_can( $taxonomy->cap->assign_terms );
279279
}
280280

281+
// Handle single comment entities with a defined object ID.
282+
if ( 'root' === $entity_kind && 'comment' === $entity_name && is_numeric( $object_id ) ) {
283+
return current_user_can( 'edit_comment', (int) $object_id );
284+
}
285+
281286
// All the remaining checks are for collections. If an object ID is provided,
282287
// reject the request.
283288
if ( null !== $object_id ) {

0 commit comments

Comments
 (0)