Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#32187 closed defect (bug) (fixed)

List table: Pages displayed in "Excerpt View"

Reported by: afercia's profile afercia Owned by: wonderboymusic's profile wonderboymusic
Milestone: 4.3 Priority: normal
Severity: normal Version: 4.2
Component: Administration Keywords: has-patch
Focuses: ui Cc:


Pages (and all hierarchical posts) listing may end up being displayed in "Excerpt view". Looks a bit weird to me since, as far as I get, the "Excerpt View" was conceived for Posts and also can see some code that tries to don't display Excerpts for hierarchical posts, namely in WP_Posts_List_Table->single_row():

if ( ! $this->hierarchical_display && 'excerpt' == $mode && current_user_can( 'read_post', $post->ID ) )

To reproduce:

  • go in the Posts listing
  • click on the "Excerpt view" icon
  • go on the Pages listing
  • click on any of the table headers links (Title, Comments, Date) to have an order different from the default 'menu_order title'
  • now you can see the "excerpts" and also the time below the date


Worth noting there's no UI control to switch view in the Pages screen.
Looks like $this->hierarchical_display is set to true only for the default order: as soon as you change order, you get the Excerpt View.
See WP_Posts_List_Table->prepare_items()

Attachments (1)

32187.diff (1.1 KB) - added by welcher 9 years ago.

Download all attachments as: .zip

Change History (10)

#1 @joedolson
9 years ago

  • Milestone changed from Awaiting Review to 4.3
  • Owner set to afercia
  • Status changed from new to assigned

9 years ago

#2 @welcher
9 years ago

  • Keywords has-patch dev-feedback added

Adding a check against a filterable array of posts types as part of the logic to display the excerpt. This fixes the issue of excerpts on the Pages view however if this is an acceptable approach, we'll need to approach the default view of Pages not showing the excerpt on load.

#3 @afercia
9 years ago

I realized that "hierarchical display" is different from "hierarchical post", yeah I'm slow :) The former is just the view meant to be used as initial view for hierarchical post, i.e. the view that allows to show the list table items "indented" below their parent.
As soon as you click on the table headers to reorder the table, it's impossible to show the indentation so it makes perfectly sense that hierarchical_display is true only when the order by is 'menu_order title'.

So maybe what's actually missing here is a way to properly display the "switch view" links. They shouldn't be displayed in the initial view but when $_GET['orderby'] is set, they really should be there. Thoughts?

#4 @afercia
9 years ago

Or maybe completely remove the excerpt view for hierarchical posts and always force $mode = 'list'. Patches would be trivial but there's the need of some UI feedback and decision, cc @helen :)

#5 @afercia
9 years ago

  • Keywords ui-feedback added

This ticket was mentioned in Slack in #design by afercia. View the logs.

9 years ago

#7 @wonderboymusic
9 years ago

  • Keywords dev-feedback ui-feedback removed
  • Owner changed from afercia to wonderboymusic

This is the same as #16213, swiching to is_post_type_hierarchical( $this->screen->post_type ) fixes it

#8 @wonderboymusic
9 years ago

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

In 32749:

In WP_Posts_List_Table::column_title(), use is_post_type_hierarchical() instead of $this->hierarchical_display in the logic to determine whether the_excerpt() should be called.

Fixes #32187.

This ticket was mentioned in Slack in #accessibility by afercia. View the logs.

8 years ago

Note: See TracTickets for help on using tickets.