Make WordPress Core

Opened 5 years ago

Closed 3 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:


There should be a post formats drop-down in edit.php so users can easily see all posts of a particular format.

Attachments (3)

posts.png (24.5 KB) - added by PeteMall 5 years ago.
Post Format Filter
15323.diff (1.7 KB) - added by wonderboymusic 3 years ago.
15323.patch (1.7 KB) - added by sscovil 3 years ago.

Download all attachments as: .zip

Change History (26)

@PeteMall5 years ago

Post Format Filter

comment:1 @PeteMall5 years ago

  • Milestone changed from 3.1 to Future Release

comment:2 @SergeyBiryukov3 years ago

  • Component changed from UI to Administration
  • Type changed from defect (bug) to enhancement

comment:3 @helen3 years ago

#17280 was marked as a duplicate.

comment:5 @DrewAPicture3 years ago

  • Cc DrewAPicture added

comment:6 @sabreuse3 years ago

  • Cc sabreuse added

comment:7 @WraithKenny3 years ago

  • Cc Ken@… added

comment:8 @beaulebens3 years ago

  • Cc beau@… added

comment:9 @beaulebens3 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() )

	if ( function_exists( 'get_current_screen' ) && $screen = get_current_screen() ) {
		if ( is_object( $screen ) && 'post' !== $screen->post_type )

	if ( empty( $_REQUEST['format'] ) )

	$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' );

@wonderboymusic3 years ago

comment:10 @wonderboymusic3 years ago

  • Keywords has-patch added; needs-patch removed
  • Milestone changed from Future Release to 3.6

comment:11 follow-up: @DrewAPicture3 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?

comment:12 @DrewAPicture3 years ago

  • Cc xoodrew@… added; DrewAPicture removed

comment:13 in reply to: ↑ 11 ; follow-up: @helen3 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?

comment:14 in reply to: ↑ 13 @DrewAPicture3 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.

comment:15 @helen3 years ago

  • Component changed from Administration to Post Formats

@sscovil3 years ago

comment:16 @sscovil3 years 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 @helen3 years ago

This filter may actually be a time where #16149 sounds nice.

comment:18 follow-up: @maor3 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?

comment:19 @helen3 years ago

We don't do it for categories, so why for post formats?

comment:20 in reply to: ↑ 18 @sscovil3 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.

comment:21 @nacin3 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.

comment:22 @helen3 years 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 @markjaquith3 years 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.


Note: See TracTickets for help on using tickets.