Changing ‘view’ link for custom post type on list post screen?

How can I change the page that the ‘view’ action links to on the list post screen for a custom post type?

Update

Read More

I’ve got it to work with normal post types using the below code but where do I define the custom post type?

function change_link($post_url,$post) {
    return '/video?id='.$post->ID;
}
add_filter('post_link',"change_link",10,2);

Related posts

Leave a Reply

2 comments

  1. Based on the update of your question:

    function change_link( $permalink, $post ) {
        if( $post->post_type == 'video' ) { // assuming the post type is video
            $permalink = home_url( 'video?id='.$post->ID );
        }
        return $permalink;
    }
    add_filter('post_type_link',"change_link",10,2);