Skip to content

Instantly share code, notes, and snippets.

@simongcc
Last active January 2, 2016 11:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simongcc/8296226 to your computer and use it in GitHub Desktop.
Save simongcc/8296226 to your computer and use it in GitHub Desktop.
Display additional column in post/custom post list in Wordpress
/*
Version Tested: 3.6, 3.8
*/
/* Display custom column */
function display_posts_stickiness( $column, $post_id ) {
the_author();
}
add_action( 'manage_posts_custom_column' , 'display_posts_stickiness', 10, 2 );
/* Add custom column to post list */
function add_sticky_column( $columns ) {
return array_merge( $columns,
array( 'author' => __( 'Author', 'wotheme' ) ) );
}
add_filter( 'manage_posts_columns' , 'add_sticky_column' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment