Skip to content

Commit ae418d5

Browse files
committed
Remove real-time collaboration.
Removes all RTC related code from core. There will still be RTC related code in Gutenberg, but effectively disabled for core since nothing turns it on. The wp.sync global has also been hidden by bundling in WordPress/gutenberg#78085. Developed in: WordPress/wordpress-develop#11774. Props maxschmeling, ellatrix, mukesh27. Fixes #65205. Built from https://develop.svn.wordpress.org/trunk@62334 git-svn-id: http://core.svn.wordpress.org/trunk@61615 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 parent 8d38a75 commit ae418d5

22 files changed

Lines changed: 36 additions & 1400 deletions

wp-admin/css/list-tables-rtl.css

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -636,22 +636,6 @@ tr.wp-locked .row-actions .trash {
636636
display: none;
637637
}
638638

639-
.wp-collaborative-editing .locked-info {
640-
display: block;
641-
}
642-
643-
.join-action-text {
644-
display: none;
645-
}
646-
647-
.wp-collaborative-editing .edit-action-text {
648-
display: none;
649-
}
650-
651-
.wp-collaborative-editing .join-action-text {
652-
display: inline;
653-
}
654-
655639
#menu-locations-wrap .widefat {
656640
width: 60%;
657641
}

wp-admin/css/list-tables-rtl.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wp-admin/css/list-tables.css

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -635,22 +635,6 @@ tr.wp-locked .row-actions .trash {
635635
display: none;
636636
}
637637

638-
.wp-collaborative-editing .locked-info {
639-
display: block;
640-
}
641-
642-
.join-action-text {
643-
display: none;
644-
}
645-
646-
.wp-collaborative-editing .edit-action-text {
647-
display: none;
648-
}
649-
650-
.wp-collaborative-editing .join-action-text {
651-
display: inline;
652-
}
653-
654638
#menu-locations-wrap .widefat {
655639
width: 60%;
656640
}

wp-admin/css/list-tables.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wp-admin/includes/class-wp-posts-list-table.php

Lines changed: 12 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,16 +1119,10 @@ public function column_title( $post ) {
11191119
$lock_holder = wp_check_post_lock( $post->ID );
11201120

11211121
if ( $lock_holder ) {
1122-
if ( get_option( 'wp_collaboration_enabled' ) ) {
1123-
$locked_avatar = '';
1124-
/* translators: Collaboration status message for a singular post in the post list. Can be any type of post. */
1125-
$locked_text = esc_html_x( 'Currently being edited', 'post list' );
1126-
} else {
1127-
$lock_holder = get_userdata( $lock_holder );
1128-
$locked_avatar = get_avatar( $lock_holder->ID, 18 );
1129-
/* translators: %s: User's display name. */
1130-
$locked_text = esc_html( sprintf( __( '%s is currently editing' ), $lock_holder->display_name ) );
1131-
}
1122+
$lock_holder = get_userdata( $lock_holder );
1123+
$locked_avatar = get_avatar( $lock_holder->ID, 18 );
1124+
/* translators: %s: User's display name. */
1125+
$locked_text = esc_html( sprintf( __( '%s is currently editing' ), $lock_holder->display_name ) );
11321126
} else {
11331127
$locked_avatar = '';
11341128
$locked_text = '';
@@ -1433,11 +1427,7 @@ public function single_row( $post, $level = 0 ) {
14331427
$lock_holder = wp_check_post_lock( $post->ID );
14341428

14351429
if ( $lock_holder ) {
1436-
if ( get_option( 'wp_collaboration_enabled' ) ) {
1437-
$classes .= ' wp-collaborative-editing';
1438-
} else {
1439-
$classes .= ' wp-locked';
1440-
}
1430+
$classes .= ' wp-locked';
14411431
}
14421432

14431433
if ( $post->post_parent ) {
@@ -1491,44 +1481,13 @@ protected function handle_row_actions( $item, $column_name, $primary ) {
14911481
$title = _draft_or_post_title();
14921482

14931483
if ( $can_edit_post && 'trash' !== $post->post_status ) {
1494-
$is_rtc_enabled = (bool) get_option( 'wp_collaboration_enabled' );
1495-
1496-
/*
1497-
* When RTC is enabled, both "Edit" and "Join" labels are rendered.
1498-
* The visible label is toggled by CSS based on the row's
1499-
* `wp-collaborative-editing` class, which is added or removed by
1500-
* inline-edit-post.js in response to heartbeat ticks.
1501-
*/
1502-
if ( $is_rtc_enabled ) {
1503-
$actions['edit'] = sprintf(
1504-
'<a href="%1$s">'
1505-
. '<span class="edit-action-text">'
1506-
. '<span aria-hidden="true">%2$s</span>'
1507-
. '<span class="screen-reader-text">%3$s</span>'
1508-
. '</span>'
1509-
. '<span class="join-action-text">'
1510-
. '<span aria-hidden="true">%4$s</span>'
1511-
. '<span class="screen-reader-text">%5$s</span>'
1512-
. '</span>'
1513-
. '</a>',
1514-
get_edit_post_link( $post->ID ),
1515-
__( 'Edit' ),
1516-
/* translators: %s: Post title. */
1517-
sprintf( __( 'Edit &#8220;%s&#8221;' ), $title ),
1518-
/* translators: Action link text for a singular post in the post list. Can be any type of post. */
1519-
_x( 'Join', 'post list' ),
1520-
/* translators: %s: Post title. */
1521-
sprintf( __( 'Join editing &#8220;%s&#8221;', 'post list' ), $title )
1522-
);
1523-
} else {
1524-
$actions['edit'] = sprintf(
1525-
'<a href="%s" aria-label="%s">%s</a>',
1526-
get_edit_post_link( $post->ID ),
1527-
/* translators: %s: Post title. */
1528-
esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $title ) ),
1529-
__( 'Edit' )
1530-
);
1531-
}
1484+
$actions['edit'] = sprintf(
1485+
'<a href="%s" aria-label="%s">%s</a>',
1486+
get_edit_post_link( $post->ID ),
1487+
/* translators: %s: Post title. */
1488+
esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $title ) ),
1489+
__( 'Edit' )
1490+
);
15321491

15331492
/**
15341493
* Filters whether Quick Edit should be enabled for the given post type.

wp-admin/includes/misc.php

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,8 +1136,7 @@ function _customizer_mobile_viewport_meta( $viewport_meta ) {
11361136
* @return array The Heartbeat response.
11371137
*/
11381138
function wp_check_locked_posts( $response, $data, $screen_id ) {
1139-
$checked = array();
1140-
$is_rtc_enabled = (bool) get_option( 'wp_collaboration_enabled' );
1139+
$checked = array();
11411140

11421141
if ( array_key_exists( 'wp-check-locked-posts', $data ) && is_array( $data['wp-check-locked-posts'] ) ) {
11431142
foreach ( $data['wp-check-locked-posts'] as $key ) {
@@ -1153,23 +1152,15 @@ function wp_check_locked_posts( $response, $data, $screen_id ) {
11531152
$user = get_userdata( $user_id );
11541153

11551154
if ( $user && current_user_can( 'edit_post', $post_id ) ) {
1156-
if ( $is_rtc_enabled ) {
1157-
$send = array(
1158-
/* translators: Collaboration status message for a singular post in the post list. Can be any type of post. */
1159-
'text' => _x( 'Currently being edited', 'post list' ),
1160-
'collaborative' => true,
1161-
);
1162-
} else {
1163-
$send = array(
1164-
'name' => $user->display_name,
1165-
/* translators: %s: User's display name. */
1166-
'text' => sprintf( __( '%s is currently editing' ), $user->display_name ),
1167-
);
1168-
1169-
if ( get_option( 'show_avatars' ) ) {
1170-
$send['avatar_src'] = get_avatar_url( $user->ID, array( 'size' => 18 ) );
1171-
$send['avatar_src_2x'] = get_avatar_url( $user->ID, array( 'size' => 36 ) );
1172-
}
1155+
$send = array(
1156+
'name' => $user->display_name,
1157+
/* translators: %s: User's display name. */
1158+
'text' => sprintf( __( '%s is currently editing' ), $user->display_name ),
1159+
);
1160+
1161+
if ( get_option( 'show_avatars' ) ) {
1162+
$send['avatar_src'] = get_avatar_url( $user->ID, array( 'size' => 18 ) );
1163+
$send['avatar_src_2x'] = get_avatar_url( $user->ID, array( 'size' => 36 ) );
11731164
}
11741165

11751166
$checked[ $key ] = $send;

wp-admin/includes/schema.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -563,9 +563,6 @@ function populate_options( array $options = array() ) {
563563

564564
// 6.9.0
565565
'wp_notes_notify' => 1,
566-
567-
// 7.0.0
568-
'wp_collaboration_enabled' => 0,
569566
);
570567

571568
// 3.3.0

wp-admin/js/inline-edit-post.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -614,8 +614,7 @@ $( function() {
614614
}
615615
}).on( 'heartbeat-tick.wp-check-locked-posts', function( e, data ) {
616616
var locked = data['wp-check-locked-posts'] || {},
617-
isRtc = window._wpCollaborationEnabled,
618-
lockedClass = isRtc ? 'wp-collaborative-editing' : 'wp-locked';
617+
lockedClass = 'wp-locked';
619618

620619
$('#the-list tr').each( function(i, el) {
621620
var key = el.id, row = $(el), lock_data, avatar;
@@ -626,7 +625,7 @@ $( function() {
626625
row.find('.column-title .locked-text').text( lock_data.text );
627626
row.find('.check-column checkbox').prop('checked', false);
628627

629-
if ( ! isRtc && lock_data.avatar_src ) {
628+
if ( lock_data.avatar_src ) {
630629
avatar = $( '<img />', {
631630
'class': 'avatar avatar-18 photo',
632631
width: 18,

wp-admin/js/inline-edit-post.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wp-admin/options-writing.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -109,21 +109,6 @@
109109
</select>
110110
</td>
111111
</tr>
112-
<tr>
113-
<th scope="row"><?php _e( 'Collaboration' ); ?></th>
114-
<td>
115-
<?php if ( wp_is_collaboration_allowed() ) : ?>
116-
<label for="wp_collaboration_enabled">
117-
<input name="wp_collaboration_enabled" type="checkbox" id="wp_collaboration_enabled" value="1" <?php checked( '1', (bool) get_option( 'wp_collaboration_enabled' ) ); ?> />
118-
<?php _e( "Enable early access to real-time collaboration. Real-time collaboration may affect your website's performance." ); ?>
119-
</label>
120-
<?php else : ?>
121-
<div class="notice notice-warning inline">
122-
<p><?php _e( '<strong>Note:</strong> Real-time collaboration has been disabled.' ); ?></p>
123-
</div>
124-
<?php endif; ?>
125-
</td>
126-
</tr>
127112
<?php
128113
if ( get_option( 'link_manager_enabled' ) ) :
129114
?>

0 commit comments

Comments
 (0)