Ticket #24908: 24908.3.diff
File 24908.3.diff, 3.0 KB (added by , 12 years ago) |
---|
-
wp-admin/includes/revision.php
73 73 /** This filter is documented in wp-admin/includes/revision.php */ 74 74 $content_to = apply_filters( "_wp_post_revision_field_$field", $compare_to->$field, $field, $compare_to, 'to' ); 75 75 76 $diff = wp_text_diff( $content_from, $content_to, array( 'show_split_view' => true ) ); 76 /** 77 * Filter revisions table structure. 78 * 79 * Specify revision comparison table as default split (two columns) or not split (single column). 80 * 81 * @since 3.8.0 82 * @param boolean null Whether to display revisions in a split view. 83 */ 84 $show_split_view = apply_filters( 'show_revisions_split_view', true ); 85 $diff = wp_text_diff( $content_from, $content_to, array( 'show_split_view' => $show_split_view ) ); 77 86 78 87 if ( ! $diff && 'post_title' === $field ) { 79 88 // It's a better user experience to still show the Title, even if it didn't change. -
wp-includes/wp-diff.php
154 154 $r = ''; 155 155 foreach ($lines as $line) { 156 156 if ( $encode ) 157 $line = htmlspecialchars( $line ); 157 158 /** 159 * Contextually filter a diffed line. 160 * 161 * Filters TextDiff default application of htmlspecialchars to the returned html for 162 * all diff calculations. This filter is passed the unfiltered html and the context: 163 * 'added', 'deleted' or 'context' (unchanged). 164 * 165 * @since 3.8.0 166 * @param String $line The unfiltered diffed line. 167 * @param string null The lines context. Values are 'added', 'deleted' or 'context' (unchanged). 168 */ 169 $line = apply_filters( 'process_text_diff_html', htmlspecialchars( $line ), $line, 'added' ); 158 170 if ( $this->_show_split_view ) { 159 171 $r .= '<tr>' . $this->emptyLine() . $this->emptyLine() . $this->addedLine( $line ) . "</tr>\n"; 160 172 } else { … … 176 188 $r = ''; 177 189 foreach ($lines as $line) { 178 190 if ( $encode ) 179 $line = htmlspecialchars( $line ); 191 /** This filter is documented in /wp-includes/wp-diff.php */ 192 $line = apply_filters( 'process_text_diff_html', htmlspecialchars( $line ), $line, 'deleted' ); 180 193 if ( $this->_show_split_view ) { 181 194 $r .= '<tr>' . $this->deletedLine( $line ) . $this->emptyLine() . $this->emptyLine() . "</tr>\n"; 182 195 } else { … … 199 212 $r = ''; 200 213 foreach ($lines as $line) { 201 214 if ( $encode ) 202 $line = htmlspecialchars( $line ); 215 /** This filter is documented in /wp-includes/wp-diff.php */ 216 $line = apply_filters( 'process_text_diff_html', htmlspecialchars( $line ), $line, 'context' ); 203 217 if ( $this->_show_split_view ) { 204 218 $r .= '<tr>' . $this->contextLine( $line ) . $this->emptyLine() . $this->contextLine( $line ) . "</tr>\n"; 205 219 } else {