manage_posts_custom_column not working
-
Hi,
I created a custom post type of ‘Portfolio’ that work well.
On the ‘Portfolio’ page (where you see all post uner Portfolio..) I changed the columns with this code: (it works well)
add_filter('manage_edit-portfolio_columns', 'portfolio_edit_columns'); function portfolio_edit_columns($columns){ $columns = array( 'cb' => '<input type="checkbox" />', 'title' => 'Project Title', 'description' => 'Description', 'skills' => 'Skills', 'date_completed' => 'Date Completed', ); return $columns; }
Now I’m trying to populate those columns but it doesn’t work.. I looked at the Codex and am using the same code as them but it still doesn’t work..
add_action('manage_posts_custom_column', 'portfolio_custom_columns'); function portfolio_custom_columns($column){ global $post; switch ($column){ case 'description': the_excerpt(); break; case 'skills': $terms = get_the_term_list( $post->ID , 'skills' , '' , ', ' , '' ); if( is_string( $terms ) ){ echo $terms; }else{ echo 'Unable to get skill(s)'; } break; case 'date_completed': echo 'date'; break; } }
In the admin section I can see the new columns but they are empty, even the date completed (which only echo ‘date’) is empty.. Looks like the function never gets called..
Any help is appreciated..
Thanks,
Nicolas
Viewing 12 replies - 1 through 12 (of 12 total)
Viewing 12 replies - 1 through 12 (of 12 total)
- The topic ‘manage_posts_custom_column not working’ is closed to new replies.