[wp-trac] [WordPress Trac] #24313: Filter Columns by View

WordPress Trac noreply at wordpress.org
Sat May 11 14:12:54 UTC 2013


#24313: Filter Columns by View
-----------------------------+------------------------------
 Reporter:  chriscct7        |       Owner:
     Type:  feature request  |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Administration   |     Version:
 Severity:  normal           |  Resolution:
 Keywords:                   |
-----------------------------+------------------------------

Comment (by chriscct7):

 This is what you can use. I'm using it to remove columns, but you could
 use it to add new ones conditionally as well.
 {{{
 function edd_fes_columns_head( $defaults ) {
     // Check that this is not all view, else it throws an error
     if ( isset( $_REQUEST[ 'post_status' ] ) ) {
         // Remove the sales from pending and draft products
         if ( $_REQUEST[ 'post_status' ] == 'pending' || $_REQUEST[
 'post_status' ] == 'draft' ) {
             unset( $defaults[ 'sales' ] );
         }
     }
 }
 add_filter( 'manage_edit-download_columns', array( $this,
 'edd_fes_columns_head' ) );
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/24313#comment:7>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list