Answer the question
In order to leave comments, you need to log in
How to add a column with post IDs in a WordPress list?
Good!
As in the admin panel, add a column with the post ID to the list of posts
Thanks in advance!
Answer the question
In order to leave comments, you need to log in
add_filter('manage_posts_columns', 'my_posts_columns_id', 5);
add_action('manage_posts_custom_column', 'my_posts_custom_id_columns', 5, 2);
function my_posts_columns_id($columns){
$columns['my_post_id'] = __('ID');
return $columns;
}
function my_posts_custom_id_columns($column_name, $id){
if($column_name === 'my_post_id'){
echo $id;
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question