Skip to content

Instantly share code, notes, and snippets.

@prorev
Created May 10, 2016 11:42
Show Gist options
  • Save prorev/ba943b4a8568d45c4f9edafe05694943 to your computer and use it in GitHub Desktop.
Save prorev/ba943b4a8568d45c4f9edafe05694943 to your computer and use it in GitHub Desktop.
function filter_media_comment_status( $open, $post_id ) {
$post = get_post( $post_id );
if( $post->post_type == 'attachment' ) {
return false;
}
return $open;
}
add_filter( 'comments_open', 'filter_media_comment_status', 10 , 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment