[wp-trac] [WordPress Trac] #14004: Custom columns for admin menu not working for custom post type with hierarchy

WordPress Trac wp-trac at lists.automattic.com
Sun Jun 20 10:14:08 UTC 2010


#14004: Custom columns for admin menu not working for custom post type with
hierarchy
--------------------------+-------------------------------------------------
 Reporter:  cubehouse     |       Owner:                                          
     Type:  defect (bug)  |      Status:  new                                     
 Priority:  normal        |   Milestone:  Unassigned                              
Component:  Post Types    |     Version:  3.0                                     
 Severity:  normal        |    Keywords:  post type hierarchical hierarchy columns
--------------------------+-------------------------------------------------

Old description:

> When enabling a custom post-type to be hierarchical:
> $args = array(
> ...
>         'hierarchical' => true
> ...
> );
>
> When trying to show custom columns, everything displays blank.
> The columns themselves appear, but the data inside them do not.
>
> By disabling hierarchical post types, all the date appears.
>
> I.e, this action hook does not trigger when post type is hierarchical.
>
> add_action('manage_posts_custom_column',  'my_show_columns');
> function my_show_columns($name) {
>     global $post;
>     switch ($name) {
>         case 'views':
>             echo "Show something";
>     }
> }

New description:

 When enabling a custom post-type to be hierarchical:
 {{{
 $args = array(
 ...
         'hierarchical' => true
 ...
 );
 }}}

 When trying to show custom columns, everything displays blank.
 The columns themselves appear, but the data inside them do not.

 By disabling hierarchical post types, all the date appears.

 I.e, this action hook does not trigger when post type is hierarchical.

 {{{
 add_action('manage_posts_custom_column',  'my_show_columns');
 function my_show_columns($name) {
     global $post;
     switch ($name) {
         case 'views':
             echo "Show something";
     }
 }
 }}}

--

Comment(by dd32):

 Off the top of my head, This may be because page_rows() is used to display
 hierarchical types (instead of post_rows())

 Can you try using the page filter instead? (I'm thinking its
 'manage_pages_custom_column'?)

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


More information about the wp-trac mailing list