Opened 3 years ago
Closed 3 months ago
#15323 closed enhancement (wontfix)
Filter by post format in wp-admin/edit
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Post Formats | Version: | 3.1 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | xoodrew@…, sabreuse, Ken@…, beau@…, maorhaz@… |
Description
There should be a post formats drop-down in edit.php so users can easily see all posts of a particular format.
Attachments (3)
Change History (26)
comment:2
SergeyBiryukov
— 6 months ago
- Component changed from UI to Administration
- Type changed from defect (bug) to enhancement
comment:4
DrewAPicture
— 5 months ago
Related #16047
comment:5
DrewAPicture
— 5 months ago
- Cc DrewAPicture added
comment:7
WraithKenny
— 5 months ago
- Cc Ken@… added
comment:8
beaulebens
— 5 months ago
- Cc beau@… added
comment:9
beaulebens
— 5 months ago
FWIW, here's what I'm currently using in a theme I'm working on:
function homeroom_manage_posts_formats( &$wp_query ) {
if ( !is_admin() )
return;
if ( function_exists( 'get_current_screen' ) && $screen = get_current_screen() ) {
if ( is_object( $screen ) && 'post' !== $screen->post_type )
return;
}
if ( empty( $_REQUEST['format'] ) )
return;
$post_format_tax_query = array(
'taxonomy' => 'post_format',
'field' => 'slug',
'terms' => 'post-format-' . esc_attr( $_REQUEST['format'] ),
'operator' => 'IN'
);
$tax_query = $wp_query->get( 'tax_query' );
if ( is_array( $tax_query ) ) {
$tax_query = $tax_query + $post_format_tax_query;
} else {
$tax_query = array( $post_format_tax_query );
}
$wp_query->set( 'tax_query', $tax_query );
}
add_action( 'pre_get_posts', 'homeroom_manage_posts_formats' );
wonderboymusic
— 4 months ago
comment:10
wonderboymusic
— 4 months ago
- Keywords has-patch added; needs-patch removed
- Milestone changed from Future Release to 3.6
comment:11
follow-up:
↓ 13
DrewAPicture
— 4 months ago
RE: 15323.diff
Along the vein of ticket:16047:16, if we're going to show a column on edit.php shouldn't we allow filtering by post format regardless of whether there is theme support?
comment:12
DrewAPicture
— 4 months ago
- Cc xoodrew@… added; DrewAPicture removed
comment:13
in reply to:
↑ 11
;
follow-up:
↓ 14
helen
— 4 months ago
Replying to DrewAPicture:
shouldn't we allow filtering by post format regardless of whether there is theme support?
I'm not seeing a check for theme support in the patch - am I missing something?
comment:14
in reply to:
↑ 13
DrewAPicture
— 4 months ago
Replying to helen:
I'm not seeing a check for theme support in the patch - am I missing something?
That's my bad. I saw the post type supports check and it didn't click.
comment:15
helen
— 4 months ago
- Component changed from Administration to Post Formats
comment:16
sscovil
— 4 months ago
Because terms are not created until a post format is used, we should probably use 'hide_if_empty'. Added a new patch.
comment:17
helen
— 4 months ago
This filter may actually be a time where #16149 sounds nice.
comment:18
follow-up:
↓ 20
maor
— 4 months ago
- Cc maorhaz@… added
While I do like this idea, I'd suggest a way for users who are not interested in this additional dropdown to be able to easily hide it. We can do it by simply adding a filter to the post_type_supports check , that is automatically set to true. Here's what I mean:
...
if ( post_type_supports( $this->screen->post_type, 'post-formats' ) && apply_filters( 'show_post_formats_dropdown', true ) ) {
...
Or we can be a bit more specific and allow extra control, up to a level of a post type.
...
if ( post_type_supports( $this->screen->post_type, 'post-formats' ) && apply_filters( "show_post_formats_dropdown_for_{$this->screen->post_type}", true ) ) {
...
What do you guys think about this approach?
comment:19
helen
— 4 months ago
We don't do it for categories, so why for post formats?
comment:20
in reply to:
↑ 18
sscovil
— 4 months ago
@maor: I agree with @helen. Plus, keep in mind that if a user has not made use of any post format other than 'standard', this filter option does not appear.
comment:21
nacin
— 4 months ago
I am hesitating here — is this needed UI? We're going to try to avoid a column for 3.6, and instead have an icon (with alternative text / tooltip / etc) that is clickable, just like items listed in the current post format, author, and other taxonomy columns.
As it is, we have too many items across the top; they have a tendency to wrap on even 1024 screens. I'd rather they go away, not grow.
comment:22
helen
— 4 months ago
Eh, I'm not in love with those filters, either. If the icons are clickable to filter, that's a fine solution to me, and also neatly avoids the querying for standard posts thing.
comment:23
markjaquith
— 3 months ago
- Milestone 3.6 deleted
- Resolution set to wontfix
- Status changed from new to closed
We're going to make clickable icons, and then we can lose the column entirely, and just let clicking the icon be the filtering method.
Post Format Filter