Created
December 12, 2017 15:12
-
-
Save larodiel/32d67e5a7f8e4c0f89ae94e5b38fb897 to your computer and use it in GitHub Desktop.
Show the post ID on admin column
This file contains hidden or 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
<?php | |
add_filter( 'manage_posts_columns', 'revealid_add_id_column', 5 ); | |
add_action( 'manage_posts_custom_column', 'revealid_id_column_content', 5, 2 ); | |
function revealid_add_id_column( $columns ) { | |
$columns['revealid_id'] = 'ID'; | |
return $columns; | |
} | |
function revealid_id_column_content( $column, $id ) { | |
if( 'revealid_id' == $column ) { | |
echo $id; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment