#32187 closed defect (bug) (fixed)
List table: Pages displayed in "Excerpt View"
Reported by: | afercia | Owned by: | wonderboymusic |
---|---|---|---|
Milestone: | 4.3 | Priority: | normal |
Severity: | normal | Version: | 4.2 |
Component: | Administration | Keywords: | has-patch |
Focuses: | ui | Cc: |
Description
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 ) ) the_excerpt();
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
Screenshot:
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()
https://core.trac.wordpress.org/browser/tags/4.2/src/wp-admin/includes/class-wp-posts-list-table.php#L109
Attachments (1)
Change History (10)
#1
@
10 years ago
- Milestone changed from Awaiting Review to 4.3
- Owner set to afercia
- Status changed from new to assigned
#3
@
10 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
@
10 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 :)
This ticket was mentioned in Slack in #design by afercia. View the logs.
10 years ago
#7
@
10 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
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.