Skip to content

Instantly share code, notes, and snippets.

@mauriciogofas
Forked from raewrites/test.php
Last active August 29, 2015 14:15
Show Gist options
  • Save mauriciogofas/bb03483e843aa8a5c270 to your computer and use it in GitHub Desktop.
Save mauriciogofas/bb03483e843aa8a5c270 to your computer and use it in GitHub Desktop.
Display Post and Page IDs in the WordPress Admin
// fonte: http://premium.wpmudev.org/blog/display-wordpress-post-page-ids/
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