WordPress.org

Make WordPress Core

Ticket #42402: 42402.2.diff

File 42402.2.diff, 1.4 KB (added by adamsilverstein, 3 years ago)
  • src/wp-admin/includes/revision.php

    diff --git src/wp-admin/includes/revision.php src/wp-admin/includes/revision.php
    index be2a791cba..07a4c498f4 100644
    function wp_get_revision_ui_diff( $post, $compare_from, $compare_to ) { 
    111111                        // It's a better user experience to still show the Title, even if it didn't change.
    112112                        // No, you didn't see this.
    113113                        $diff  = '<table class="diff"><colgroup><col class="content diffsplit left"><col class="content diffsplit middle"><col class="content diffsplit right"></colgroup><tbody><tr>';
    114                         $diff .= '<td>' . esc_html( $compare_from->post_title ) . '</td><td></td><td>' . esc_html( $compare_to->post_title ) . '</td>';
    115                         $diff .= '</tr></tbody>';
     114
     115                        // In split screen mode, show the title before/after side by side.
     116                        if ( true === $args['show_split_view'] ) {
     117                                $diff .= '<td>' . esc_html( $compare_from->post_title ) . '</td><td></td><td>' . esc_html( $compare_to->post_title ) . '</td>';
     118                        } else {
     119                                $diff .= '<td>' . esc_html( $compare_from->post_title ) . '</td>';
     120
     121                                // In single column mode, only show the title once if unchanged.
     122                                if ( $compare_from->post_title !== $compare_to->post_title ) {
     123                                        $diff .= '</tr><tr><td>' . esc_html( $compare_to->post_title ) . '</td>';
     124                                }
     125                        }
     126
     127                        $diff .= '</tr></tbody>';
    116128                        $diff .= '</table>';
    117129                }
    118130