How to use hook admin_init for add_action for custom post type column
Hooking this into admin_init will ensure that the code only runs in the admin panel, but it’s not the proper way to do so as it prevents other plugins from accessing the new column before that hook. You could simply use is_admin() to determine whether the current page is an admin page. if ( is_admin() … Read more