Opened 14 years ago
Closed 12 years ago
#15323 closed enhancement (wontfix)
Filter by post format in wp-admin/edit
Reported by: | PeteMall | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.1 |
Component: | Post Formats | Keywords: | has-patch |
Focuses: | Cc: |
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)
#2
@
12 years ago
- Component changed from UI to Administration
- Type changed from defect (bug) to enhancement
#9
@
12 years 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' );
#10
@
12 years ago
- Keywords has-patch added; needs-patch removed
- Milestone changed from Future Release to 3.6
#11
follow-up:
↓ 13
@
12 years 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?
#13
in reply to:
↑ 11
;
follow-up:
↓ 14
@
12 years 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?
#14
in reply to:
↑ 13
@
12 years 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.
#16
@
12 years ago
Because terms are not created until a post format is used, we should probably use 'hide_if_empty'. Added a new patch.
#18
follow-up:
↓ 20
@
12 years 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?
#20
in reply to:
↑ 18
@
12 years 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.
#21
@
12 years 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.
Post Format Filter