Created
November 15, 2012 08:24
-
-
Save ataylorme/4077372 to your computer and use it in GitHub Desktop.
Add page/post ID to backend
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
<?php | |
function posts_columns_id($defaults){ | |
$defaults['wps_post_id'] = __('ID'); | |
return $defaults; | |
}// end posts_columns_id function | |
function posts_custom_id_columns($column_name, $id){ | |
if($column_name === 'wps_post_id'){ | |
echo $id; | |
} | |
}// end posts_custom_id_columns function | |
add_filter('manage_posts_columns', 'posts_columns_id', 5); | |
add_action('manage_posts_custom_column', 'posts_custom_id_columns', 5, 2); | |
add_filter('manage_pages_columns', 'posts_columns_id', 5); | |
add_action('manage_pages_custom_column', 'posts_custom_id_columns', 5, 2); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment