Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Disable Comments on Media Attachment Pages
Browse files Browse the repository at this point in the history
  • Loading branch information
szk11001 committed Nov 25, 2014
1 parent 0fa172a commit 1477915
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,4 +284,14 @@ function hale_main_nav_fallback($args) {
}
return;
}

function disable_comments_media_attachments( $open, $post_id ){
$post = get_post_type( $post_id );
if( $post == 'attachment' ) {
$open = false;
}
return $open;
}
add_filter('comments_open', 'disable_comments_media_attachments', 10 , 2);

?>

0 comments on commit 1477915

Please sign in to comment.