Skip to content

Instantly share code, notes, and snippets.

@carl-alberto
Last active July 24, 2016 18:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carl-alberto/78a38ac632a5c83d836c5e14873ff9e9 to your computer and use it in GitHub Desktop.
Save carl-alberto/78a38ac632a5c83d836c5e14873ff9e9 to your computer and use it in GitHub Desktop.
Jetpack plugin carousel disable comments
<?php
function jetpack_carousel_disable_comment( $jpimages, $postid ) {
$posts = get_post( $postid );
if( $posts->post_type == 'attachment' ) {
return false;
}
return $jpimages;
}
add_filter( 'comments_open', 'jetpack_carousel_disable_comment', 10 , 5 );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment