WordPress.org

Make WordPress Core

Ticket #23903: 23903.2.diff

File 23903.2.diff, 1.9 KB (added by SergeyBiryukov, 5 years ago)
  • wp-admin/css/wp-admin.css

     
    36063612        width: 95%;
    36073613}
    36083614
     3615.diff-title strong:first-child {
     3616        display: none;
     3617}
     3618
     3619.comparing-two-revisions .diff-title strong:first-child {
     3620        display: inline;
     3621}
     3622
    36093623.diff-slider-ticks-wrapper {
    36103624        margin: 0 auto;
    36113625        text-align: center;
     
    36163630        z-index: 1;
    36173631        margin-top: 20px;
    36183632}
     3633.diff-label {
     3634        font-weight: bold;
     3635        display: block;
     3636        margin-top: 10px;
     3637        padding-left: 3px;
     3638        font-size: 14px;
     3639}
    36193640
    36203641.diff-header {
    36213642        height: 35px;
  • wp-admin/includes/ajax-actions.php

     
    21352135                $lines_added = $lines_deleted = 0;
    21362136                $content = '';
    21372137                //compare from left to right, passed from application
    2138                 foreach ( array_keys( _wp_post_revision_fields() ) as $field ) {
     2138                foreach ( _wp_post_revision_fields() as $field => $field_value ) {
    21392139                        $left_content = apply_filters( "_wp_post_revision_field_$field", $left_revision->$field, $field, $left_revision, 'left' );
    21402140                        $right_content = apply_filters( "_wp_post_revision_field_$field", $right_revision->$field, $field, $right_revision, 'right' );
    21412141
     
    21492149                        // compare_to == 0 means first revision, so compare to a blank field to show whats changed
    21502150                        $diff = wp_text_diff_with_count( ( 0 == $compare_to ) ? '' : $left_content, $right_content, $args );
    21512151
    2152                         if ( isset( $diff[ 'html' ] ) )
     2152                        if ( isset( $diff[ 'html' ] ) ) {
     2153                                $content .= sprintf( '<label class="diff-label">%s</label>', $field_value );
    21532154                                $content .= $diff[ 'html' ];
     2155                        }
    21542156
    21552157                        if ( isset( $diff[ 'lines_added' ] ) )
    21562158                                $lines_added = $lines_added + $diff[ 'lines_added' ];