[wp-trac] [WordPress Trac] #31989: Allow developer to default hide columns

WordPress Trac noreply at wordpress.org
Thu Apr 16 02:52:42 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 SergeyBiryukov):

 > Currently, the only way to hide columns by default is to write
 everyone's user_meta with the array for the hidden columns on a particular
 screen.

 You can use
 [https://developer.wordpress.org/reference/hooks/get_user_option_option/
 get_user_option filter] without actually writing user meta:
 {{{
 function wp31989_set_hidden_columns_for_posts_screen( $result ) {
         if ( ! $result ) {
                 $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:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list