#23929 closed enhancement (fixed)
Ability to remove post format UI
Reported by: | 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)
Change History (23)
#2
follow-up:
↓ 16
@
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
@
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
@
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
.
#10
follow-up:
↓ 18
@
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.
#12
follow-up:
↓ 13
@
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
@
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.
#16
in reply to:
↑ 2
;
follow-up:
↓ 17
@
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
@
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.
See also #23930