Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //defining
- add_filter('manage_posts_columns', 'dct_table_head'); //use manage_{$post_type}_posts_columns for custom post type
- function dct_table_head( $defaults ) {
- $defaults['column1'] = 'Column1';
- $defaults['column2'] = 'Column2';
- }
- //configuring data
- add_action( 'manage_posts_custom_column', 'dct_table_content', 10, 2 ); //use manage_{$post_type}_posts_custom_columns for custom post type
- function dct_table_content( $column, $post_id ) {
- if ($column == 'column1') {
- //do your stuff here
- }
- if ($column == 'column2') {
- //do your stuff here
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement