Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#42402 closed defect (bug) (fixed)

When viewing a revision with show_split_view set to false, the title is still shown in two columns

Reported by: johnbillion's profile johnbillion Owned by: adamsilverstein's profile adamsilverstein
Milestone: 5.1 Priority: low
Severity: normal Version: 3.6
Component: Revisions Keywords: good-first-bug has-patch needs-testing
Focuses: administration Cc:

Description

The revision_text_diff_options filter can be used to set the show_split_view argument to false, which means when viewing the revisions screen for a post the differences will be shown inline instead of in two columns.

add_filter( 'revision_text_diff_options', function( array $args ) {
        $args['show_split_view'] = false;
        return $args;
} );

When this is the case, the Title field is still shown in two columns instead of one if the title has not been changed. If the title has been changed, it correctly appears in one column.

https://i.imgur.com/0Tc1ANM.png

Attachments (2)

42402.diff (1.1 KB) - added by mbelchev 6 years ago.
42402.2.diff (1.4 KB) - added by adamsilverstein 6 years ago.

Download all attachments as: .zip

Change History (10)

#1 @adamsilverstein
6 years ago

  • Keywords reporter-feedback added

@johnbillion Thanks for the bug report. I tested this out and I see the title in a single column. Can you confirm this is the behaviour with all plugins disabled and a default theme active?

https://cl.ly/1R012Y1t311B/Image%202017-11-03%20at%201.42.51%20PM.png

#2 @johnbillion
6 years ago

  • Keywords reporter-feedback removed

@adamsilverstein Thanks for testing. The Title field is shown in two columns instead of one if the title has not been changed. If the title has been changed, it correctly appears in one column.

#3 @adamsilverstein
6 years ago

@johnbillion Ah! I missed that important detail from your bug report. Thanks.

I see you marked this as a good first bug so I'll leave it for now to see if a new contributor wants to lend a hand. A head start: the title is output a little differently than the remainder of the fields, see wp-admin/includes/revisions.php:L103.

Version 0, edited 6 years ago by adamsilverstein (next)

@mbelchev
6 years ago

#4 @mbelchev
6 years ago

  • Keywords has-patch added; needs-patch removed

Hey guys, thanks for the detailed ticket! I've added a check for show_split_view and if it's set to true, show the title in two columns otherwise just show it in a new row.

btw this patch was sent during the contribution day after WordCamp Sofia 2017

Last edited 6 years ago by mbelchev (previous) (diff)

#5 @adamsilverstein
6 years ago

@mbelchev This works well in my testing, thanks for the patch!

One thing I noticed is that since we always show the title, it winds up looking odd when the title hasn't changed (the title is duplicated):

https://cl.ly/363V272o2y1A/Revisions__WordPress_Local_Development...__WordPress_2017-12-08_09-39-04.jpg

Working to remove the duplicate title, updated patch shortly.

#6 @adamsilverstein
6 years ago

  • Keywords needs-testing added
  • Milestone changed from Awaiting Review to 5.0
  • Owner set to adamsilverstein
  • Status changed from new to assigned
  • Version set to 3.6

In: 42402.2.diff

  • refresh against trunk
  • only show title twice if it has changed in single column view.

@mbelchev could you give this patch a test?

screencast: https://cl.ly/3j1i0b1c2b3g

#7 @adamsilverstein
6 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 42966:

Revisions: improve show_split_view=false support for title.

  • When show_split_view argument false, show title changes in a single column and only show title once if title is unchanged.

Props johnbillion, mbelchev.
Fixes #42402.  

#8 @johnbillion
5 years ago

  • Milestone changed from 5.0 to 5.1
Note: See TracTickets for help on using tickets.