function tweakjp_rm_comments_att( $open, $post_id ) { $post = get_post( $post_id ); if( $post->post_type == 'attachment' ) { return false; } return $open; } add_filter( 'comments_open', 'tweakjp_rm_comments_att', 10 , 2 );
function tweakjp_rm_comments_att( $open, $post_id ) { $post = get_post( $post_id ); if( $post->post_type == 'attachment' ) { return false; } return $open; } add_filter( 'comments_open', 'tweakjp_rm_comments_att', 10 , 2 );