From d1d6e8864ed0f0abc93c758af95ffca99f8008ff Mon Sep 17 00:00:00 2001 From: Adam Silverstein Date: Tue, 10 Apr 2018 16:12:30 +0000 Subject: [PATCH] Revisions: improve show_split_view=false support for title. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * When show_split_view argument false, show title changes in a single column and only show title once if title is unchanged. Props johnbillion, mbelchev. Fixes #42402.   Built from https://develop.svn.wordpress.org/trunk@42966 git-svn-id: http://core.svn.wordpress.org/trunk@42795 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/revision.php | 16 ++++++++++++++-- wp-includes/version.php | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/revision.php b/wp-admin/includes/revision.php index 6b05442370..f431493fc1 100644 --- a/wp-admin/includes/revision.php +++ b/wp-admin/includes/revision.php @@ -111,8 +111,20 @@ function wp_get_revision_ui_diff( $post, $compare_from, $compare_to ) { // It's a better user experience to still show the Title, even if it didn't change. // No, you didn't see this. $diff = ''; - $diff .= ''; - $diff .= ''; + + // In split screen mode, show the title before/after side by side. + if ( true === $args['show_split_view'] ) { + $diff .= ''; + } else { + $diff .= ''; + + // In single column mode, only show the title once if unchanged. + if ( $compare_from->post_title !== $compare_to->post_title ) { + $diff .= ''; + } + } + + $diff .= ''; $diff .= '
' . esc_html( $compare_from->post_title ) . '' . esc_html( $compare_to->post_title ) . '
' . esc_html( $compare_from->post_title ) . '' . esc_html( $compare_to->post_title ) . '' . esc_html( $compare_from->post_title ) . '
' . esc_html( $compare_to->post_title ) . '
'; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 85a48efe14..f57456c7f1 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '5.0-alpha-42965'; +$wp_version = '5.0-alpha-42966'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.