Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/wp-admin/css/list-tables.css
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,18 @@ tr.wp-locked .row-actions .trash {
display: block;
}

.join-action-text {
display: none;
}

.wp-collaborative-editing .edit-action-text {
display: none;
}

.wp-collaborative-editing .join-action-text {
display: inline;
}

#menu-locations-wrap .widefat {
width: 60%;
}
Expand Down
43 changes: 27 additions & 16 deletions src/wp-admin/includes/class-wp-posts-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -1491,24 +1491,35 @@ protected function handle_row_actions( $item, $column_name, $primary ) {
$title = _draft_or_post_title();

if ( $can_edit_post && 'trash' !== $post->post_status ) {
$is_rtc_locked = get_option( 'wp_collaboration_enabled' ) && wp_check_post_lock( $post->ID );
$is_rtc_enabled = (bool) get_option( 'wp_collaboration_enabled' );

$actions['edit'] = sprintf(
'<a href="%s" aria-label="%s">%s</a>',
get_edit_post_link( $post->ID ),
esc_attr(
sprintf(
$is_rtc_locked
/* translators: %s: Post title. */
? __( 'Join editing &#8220;%s&#8221;', 'post list' )
/* translators: %s: Post title. */
: __( 'Edit &#8220;%s&#8221;' ),
$title
)
),
if ( $is_rtc_enabled ) {
$link_text = '<span class="edit-action-text">';
$link_text .= '<span aria-hidden="true">' . __( 'Edit' ) . '</span>';
/* translators: %s: Post title. */
$link_text .= '<span class="screen-reader-text">' . sprintf( __( 'Edit &#8220;%s&#8221;' ), $title ) . '</span>';
$link_text .= '</span>';
$link_text .= '<span class="join-action-text">';
/* translators: Action link text for a singular post in the post list. Can be any type of post. */
$is_rtc_locked ? _x( 'Join', 'post list' ) : __( 'Edit' )
);
$link_text .= '<span aria-hidden="true">' . _x( 'Join', 'post list' ) . '</span>';
/* translators: %s: Post title. */
$link_text .= '<span class="screen-reader-text">' . sprintf( __( 'Join editing &#8220;%s&#8221;', 'post list' ), $title ) . '</span>';
$link_text .= '</span>';

$actions['edit'] = sprintf(
'<a href="%s">%s</a>',
get_edit_post_link( $post->ID ),
$link_text
);
} else {
$actions['edit'] = sprintf(
'<a href="%s" aria-label="%s">%s</a>',
get_edit_post_link( $post->ID ),
/* translators: %s: Post title. */
esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $title ) ),
__( 'Edit' )
);
}

/**
* Filters whether Quick Edit should be enabled for the given post type.
Expand Down
Loading