Last active
December 11, 2023 16:04
-
-
Save alanef/07d446e7fe05ae99338469a9e3959a00 to your computer and use it in GitHub Desktop.
Close commens on all events
This file contains hidden or 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 | |
/* | |
* Plugin Name: Quick Event Manager Custom Snippet - Disable Comments on Events | |
*/ | |
add_filter('comments_open', function ($open, $post_id) { | |
$post = get_post($post_id); | |
if ($post->post_type == 'event') { | |
return false; | |
} | |
return $open; | |
}, 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment