Ticket #25473: 25473.4.diff
File 25473.4.diff, 4.0 KB (added by , 4 years ago) |
---|
-
src/wp-admin/includes/revision.php
86 86 87 87 $args = array( 88 88 'show_split_view' => true, 89 'title_left' => __( 'Removed' ), 90 'title_right' => __( 'Added' ), 89 91 ); 90 92 91 93 /** -
src/wp-includes/class-wp-text-diff-renderer-table.php
176 176 } 177 177 178 178 if ( $this->_show_split_view ) { 179 $r .= '<tr>' . $this->emptyLine() . $this-> emptyLine() . $this->addedLine( $line ) . "</tr>\n";179 $r .= '<tr>' . $this->emptyLine() . $this->addedLine( $line ) . "</tr>\n"; 180 180 } else { 181 181 $r .= '<tr>' . $this->addedLine( $line ) . "</tr>\n"; 182 182 } … … 201 201 $line = apply_filters( 'process_text_diff_html', $processed_line, $line, 'deleted' ); 202 202 } 203 203 if ( $this->_show_split_view ) { 204 $r .= '<tr>' . $this->deletedLine( $line ) . $this->emptyLine() . $this->emptyLine() ."</tr>\n";204 $r .= '<tr>' . $this->deletedLine( $line ) . $this->emptyLine() . "</tr>\n"; 205 205 } else { 206 206 $r .= '<tr>' . $this->deletedLine( $line ) . "</tr>\n"; 207 207 } … … 226 226 $line = apply_filters( 'process_text_diff_html', $processed_line, $line, 'unchanged' ); 227 227 } 228 228 if ( $this->_show_split_view ) { 229 $r .= '<tr>' . $this->contextLine( $line ) . $this-> emptyLine() . $this->contextLine( $line ) . "</tr>\n";229 $r .= '<tr>' . $this->contextLine( $line ) . $this->contextLine( $line ) . "</tr>\n"; 230 230 } else { 231 231 $r .= '<tr>' . $this->contextLine( $line ) . "</tr>\n"; 232 232 } … … 319 319 $r .= $this->_deleted( array( $orig_line ), false ); 320 320 } else { // A true changed row. 321 321 if ( $this->_show_split_view ) { 322 $r .= '<tr>' . $this->deletedLine( $orig_line ) . $this-> emptyLine() . $this->addedLine( $final_line ) . "</tr>\n";322 $r .= '<tr>' . $this->deletedLine( $orig_line ) . $this->addedLine( $final_line ) . "</tr>\n"; 323 323 } else { 324 324 $r .= '<tr>' . $this->deletedLine( $orig_line ) . '</tr><tr>' . $this->addedLine( $final_line ) . "</tr>\n"; 325 325 } -
src/wp-includes/pluggable.php
2838 2838 return ''; 2839 2839 } 2840 2840 2841 $r = "<table class='diff'>\n"; 2841 $is_split_view = ! empty( $args['show_split_view'] ); 2842 $is_split_view_class = $is_split_view ? ' is-split-view' : ''; 2842 2843 2843 if ( ! empty( $args['show_split_view'] ) ) {2844 $r .= "<col class='content diffsplit left' /><col class='content diffsplit middle' /><col class='content diffsplit right' />"; 2845 } else{2846 $r .= "<c ol class='content' />";2844 $r = "<table class='diff$is_split_view_class'>\n"; 2845 2846 if ( $args['title'] ) { 2847 $r .= "<caption class='diff-title'>$args[title]</caption>\n"; 2847 2848 } 2848 2849 2849 if ( $args['title '] || $args['title_left'] || $args['title_right'] ) {2850 if ( $args['title_left'] || $args['title_right'] ) { 2850 2851 $r .= '<thead>'; 2851 2852 } 2852 if ( $args['title'] ) { 2853 $r .= "<tr class='diff-title'><th colspan='4'>$args[title]</th></tr>\n"; 2854 } 2853 2855 2854 if ( $args['title_left'] || $args['title_right'] ) { 2855 $th_or_td_left = empty( $args['title_left'] ) ? 'td' : 'th'; 2856 $th_or_td_right = empty( $args['title_right'] ) ? 'td' : 'th'; 2857 2856 2858 $r .= "<tr class='diff-sub-title'>\n"; 2857 $r .= "\t<td></td><th>$args[title_left]</th>\n"; 2858 $r .= "\t<td></td><th>$args[title_right]</th>\n"; 2859 $r .= "\t<$th_or_td_left>$args[title_left]</$th_or_td_left>\n"; 2860 if ( $is_split_view ) { 2861 $r .= "\t<$th_or_td_right>$args[title_right]</$th_or_td_right>\n"; 2862 } 2859 2863 $r .= "</tr>\n"; 2860 2864 } 2861 if ( $args['title'] || $args['title_left'] || $args['title_right'] ) { 2865 2866 if ( $args['title_left'] || $args['title_right'] ) { 2862 2867 $r .= "</thead>\n"; 2863 2868 } 2864 2869