[wp-trac] [WordPress Trac] #21240: Ability to "Turn On" Native custom columns for registered custom taxonomies

WordPress Trac wp-trac at lists.automattic.com
Sun Jul 29 21:16:05 UTC 2012


#21240: Ability to "Turn On" Native custom columns for registered custom taxonomies
-----------------------------------+------------------------------
 Reporter:  jtsternberg            |       Owner:
     Type:  feature request        |      Status:  new
 Priority:  normal                 |   Milestone:  Awaiting Review
Component:  Taxonomy               |     Version:
 Severity:  normal                 |  Resolution:
 Keywords:  2nd-opinion has-patch  |
-----------------------------------+------------------------------

Comment (by jtsternberg):

 In [http://core.trac.wordpress.org/attachment/ticket/21240/21240.4.diff
 21240.4.dff] I added

 {{{
 $this->taxonomy_columns = apply_filters( 'show_taxonomy_columns',
 $taxonomies, $post_type );
 }}}

 This line allows plugins and themes to filter the taxonomy columns. i.e.
 {{{
 add_filter( 'show_taxonomy_columns', 'add_resource_category_column', 10, 2
 );
 function add_resource_category_column( $tax_columns, $post_type ) {
         if ( $post_type == 'resources' ) $tax_columns[] = 'session-
 audiences';
         return $tax_columns;
 }
 }}}

 This allows taxonomies registered after the fact to add their columns to
 post-types.

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


More information about the wp-trac mailing list