[wp-trac] [WordPress Trac] #31989: Allow developer to default hide columns
WordPress Trac
noreply at wordpress.org
Fri May 1 03:56:06 UTC 2015
#31989: Allow developer to default hide columns
--------------------------------+------------------------------
Reporter: tychay | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Options, Meta APIs | Version: 4.1
Severity: normal | Resolution:
Keywords: | Focuses: administration
--------------------------------+------------------------------
Comment (by tychay):
Replying to [comment:3 SergeyBiryukov]:
That's a great idea, but it gets pretty hairy in non-obvious ways. The way
the code is written it depends on an artifact where screen_options()
writes an array of a single element (empty string) when all the column
boxes are unchecked. It'd probably be better to hard check for it. Also,
it takes a while to get a handle of which hook to look for
{{{get_user_option_manage<screen_id>columnshidden}}}. That's pretty opaque
to most people.
Besides, my patch is the same code and filter system as used for default
metaboxes hide/show.
> {{{
> function wp31989_set_hidden_columns_for_posts_screen( $result ) {
> if ( $result === false ) {
> $result = array( 'author', 'categories' );
> }
>
> return $result;
> }
> add_filter( 'get_user_option_manageedit-postcolumnshidden',
'wp31989_set_hidden_columns_for_posts_screen' );
> }}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/31989#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list