Created
October 29, 2013 13:18
-
-
Save theodorocaliari/7214471 to your computer and use it in GitHub Desktop.
Remove comments in WP slimjetpack carrousel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//remove comments from jetpack carrousel | |
function filter_media_comment_status( $open, $post_id ) { | |
// http://aahank.com/2013/disable-comments-jetpack-carousel/ | |
$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