Only show columns in custom post type?

I have a plugin which by default shows extra columns in all columns, not only in that post type.
How do I change this code to only show up on this specific plugin page/post type?

function modified_column_register( $columns ) {
$columns[‘time_range’] = __( ‘Display’, ‘vs’ );
$columns[‘active’] = __(‘Active’, ‘vs’);
return $columns;
}
add_filter( ‘manage_posts_columns’, ‘modified_column_register’ );

Thank you! I tried adding this without any luck:

$screen = get_current_screen();
if ( ‘visitors’ == $screen->post_type ) {

Read more here:: Only show columns in custom post type?

Leave a Reply

Your email address will not be published. Required fields are marked *