Last active
January 2, 2016 11:19
-
-
Save simongcc/8296226 to your computer and use it in GitHub Desktop.
Display additional column in post/custom post list in Wordpress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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