Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#23929 closed enhancement (fixed)

Ability to remove post format UI

Reported by: johnbillion's profile johnbillion Owned by:
Milestone: 3.6 Priority: normal
Severity: normal Version: 3.6
Component: Post Formats Keywords: has-patch
Focuses: Cc:

Description

As discussed in IRC there should be a filter to completely remove the post format UI from the post editing screen.

Patch coming up.

Attachments (2)

23929.patch (875 bytes) - added by johnbillion 12 years ago.
23929.2.patch (890 bytes) - added by johnbillion 12 years ago.

Download all attachments as: .zip

Change History (23)

@johnbillion
12 years ago

#2 follow-up: @johnbillion
12 years ago

  • Keywords has-patch added

Patch which adds a new show_post_format_ui filter (boolean) for disabling the post format UI on the post editing screen.

Example usage:

add_filter( 'show_post_format_ui', '__return_false' );

or

add_filter( 'show_post_format_ui', function( $show, $post_type ) {
	if ( 'my_post_type' == $post_type )
		return false;
	return $show;
}, 10, 2 );

I toyed with the idea of removing the post format icons that are shown next to posts on the post listing screen too, but decided they should not be affected by this filter. They're easy enough to hide with CSS anyway.

#3 @SergeyBiryukov
12 years ago

Could you replace and operator with && for consistency with other conditionals?

Looks we don't use the first one in core.

#4 @nacin
12 years ago

I'm thinking we should pass $post in, not just $post_type. And I agree on the operator change. You can fall into precedence traps very easily with and and or.

#5 @SergeyBiryukov
12 years ago

  • Milestone changed from Awaiting Review to 3.6

#6 @johnbillion
12 years ago

Patch refreshed.

#7 @SergeyBiryukov
12 years ago

Maybe 'show_post_formats_ui' vs 'show_post_format_ui'?

#8 @SergeyBiryukov
12 years ago

#23990 was marked as a duplicate.

#9 @batmoo
12 years ago

  • Cc batmoo@… added

#10 follow-up: @batmoo
12 years ago

Bringing my note from #23990 here: it would be nice to continue to maintain support for selective post formats as was possible before (e.g. I only want my theme/site to use the gallery post format) as well as just completely disabling it.

#11 @ethitter
12 years ago

  • Cc erick@… added

#12 follow-up: @ryan
12 years ago

If the filter returns false, should we should add_meta_box() on post_format_meta_box() so the old UI comes back?

#13 in reply to: ↑ 12 @nacin
12 years ago

Replying to ryan:

If the filter returns false, should we should add_meta_box() on post_format_meta_box() so the old UI comes back?

I'd argue no — that should be a separate add_meta_box() call. This is the "upgraded" meta box. If you want no UI, you can turn off the new UI. If you want the old UI, you should turn off the new UI *and* add it back.

It's also possible that we should interpret the post formats meta box being explicitly removed as the same as returning false through that filter. It depends on how other post format plugins/themes are manipulating the UI.

#14 @ryan
12 years ago

In 23946:

Allow turning off the post formats UI via a show_post_format_ui filter.

Props johnbillion
see #23929

#15 @nacin
12 years ago

In 24063:

Rename the show_post_format_ui filter to enable_post_format_ui. 'show' is a different concept - this filter entirely disables the UI. see #23929.

#16 in reply to: ↑ 2 ; follow-up: @avcascade
12 years ago

  • Cc avcascade@… added

Replying to johnbillion:

I toyed with the idea of removing the post format icons that are shown next to posts on the post listing screen too, but decided they should not be affected by this filter. They're easy enough to hide with CSS anyway.

Really appreciate your work on this, but wouldn't it make more sense to have a checkbox on the Settings > Writing screen that a user can check to completely disable Post Formats? And then gray out the selector for the default post format if the Disable Post Formats box is checked?

#17 in reply to: ↑ 16 @SergeyBiryukov
12 years ago

Replying to avcascade:

Really appreciate your work on this, but wouldn't it make more sense to have a checkbox on the Settings > Writing screen that a user can check to completely disable Post Formats?

The screen option for users is going to be added in #23930.

The filter in this ticket is a site-wide setting for developers.

#18 in reply to: ↑ 10 @SergeyBiryukov
12 years ago

Replying to batmoo:

it would be nice to continue to maintain support for selective post formats as was possible before (e.g. I only want my theme/site to use the gallery post format) as well as just completely disabling it.

Related: #24059

#19 @dway
12 years ago

  • Cc nicolasderambure@… added

Is this filter going to be in 3.6 final ?

Last edited 12 years ago by dway (previous) (diff)

#20 @DrewAPicture
12 years ago

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

See in [23946] and [24063].

Also:
#24059 proposes making the format list filterable
#24378 prososes a filter to hide post format icons in the list table

#21 @dway
12 years ago

the #24059 seems to be the more straightforward solution.

Note: See TracTickets for help on using tickets.