mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-02 11:44:33 +00:00
Revisions: Generate correct number of columns in wp_text_diff.
The function `wp_text_diff` generated an invalid table structure if the $args parameter contained any values. This patch corrects the structure generated by `wp_text_diff` and related usages so that the column count matches the data generated. Additionally, this patch passes arguments to the Revisions screen so that the screen has column headings that reflect the content in each column. Improves the accessibility and usability of the Revisions table. Props joedolson, mehulkaklotar, afercia, adamsilverstein, zodiac1978, jeremyfelt Fixes #25473 git-svn-id: https://develop.svn.wordpress.org/trunk@50034 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -176,7 +176,7 @@ class WP_Text_Diff_Renderer_Table extends Text_Diff_Renderer {
|
||||
}
|
||||
|
||||
if ( $this->_show_split_view ) {
|
||||
$r .= '<tr>' . $this->emptyLine() . $this->emptyLine() . $this->addedLine( $line ) . "</tr>\n";
|
||||
$r .= '<tr>' . $this->emptyLine() . $this->addedLine( $line ) . "</tr>\n";
|
||||
} else {
|
||||
$r .= '<tr>' . $this->addedLine( $line ) . "</tr>\n";
|
||||
}
|
||||
@@ -201,7 +201,7 @@ class WP_Text_Diff_Renderer_Table extends Text_Diff_Renderer {
|
||||
$line = apply_filters( 'process_text_diff_html', $processed_line, $line, 'deleted' );
|
||||
}
|
||||
if ( $this->_show_split_view ) {
|
||||
$r .= '<tr>' . $this->deletedLine( $line ) . $this->emptyLine() . $this->emptyLine() . "</tr>\n";
|
||||
$r .= '<tr>' . $this->deletedLine( $line ) . $this->emptyLine() . "</tr>\n";
|
||||
} else {
|
||||
$r .= '<tr>' . $this->deletedLine( $line ) . "</tr>\n";
|
||||
}
|
||||
@@ -226,7 +226,7 @@ class WP_Text_Diff_Renderer_Table extends Text_Diff_Renderer {
|
||||
$line = apply_filters( 'process_text_diff_html', $processed_line, $line, 'unchanged' );
|
||||
}
|
||||
if ( $this->_show_split_view ) {
|
||||
$r .= '<tr>' . $this->contextLine( $line ) . $this->emptyLine() . $this->contextLine( $line ) . "</tr>\n";
|
||||
$r .= '<tr>' . $this->contextLine( $line ) . $this->contextLine( $line ) . "</tr>\n";
|
||||
} else {
|
||||
$r .= '<tr>' . $this->contextLine( $line ) . "</tr>\n";
|
||||
}
|
||||
@@ -319,7 +319,7 @@ class WP_Text_Diff_Renderer_Table extends Text_Diff_Renderer {
|
||||
$r .= $this->_deleted( array( $orig_line ), false );
|
||||
} else { // A true changed row.
|
||||
if ( $this->_show_split_view ) {
|
||||
$r .= '<tr>' . $this->deletedLine( $orig_line ) . $this->emptyLine() . $this->addedLine( $final_line ) . "</tr>\n";
|
||||
$r .= '<tr>' . $this->deletedLine( $orig_line ) . $this->addedLine( $final_line ) . "</tr>\n";
|
||||
} else {
|
||||
$r .= '<tr>' . $this->deletedLine( $orig_line ) . '</tr><tr>' . $this->addedLine( $final_line ) . "</tr>\n";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user