Can’t add default comments to custom post type

I figured this out after some searching. For anyone who wants to know:

add_filter( 'comments_open', 'my_comments_open', 10, 2 );

function my_comments_open( $open, $post_id ) {

$post = get_post( $post_id );

if ( 'spark' == $post->post_type )
    $open = true;

return $open;
}

Leave a Comment