Custom admin columns for ALL custom post types

If you want to target all custom post types as well as the built in post types (posts and pages) then you need to use the manage_posts_custom_column hook instead of the manage_{post_type}_posts_custom_column hook which is used to target specific post type columns, subtle difference in naming convention but big difference in how they operate.

Example:

add_action( 'manage_posts_custom_column', 'your_callback'); 

With the above hook, you can still conditionally check for and exclude certain post types, like the built in types if they do not apply to your logic, but this is what you need to target all post types if you don’t know the post type name ahead of time.

Leave a Comment