Home / Widgets / How to Disable Comments on Event Posts? | Quick Event Manager
Duplicate Snippet

Embed Snippet on Your Site

How to Disable Comments on Event Posts? | Quick Event Manager

This code snippet is designed to automatically disable comments for event post types generated via the Quick Event Manager plugin or Quick Event Manager (Premium) plugin on the WordPress site.

(Note this code snippet applies for "Quick Event Manager Plugin" available here: https://fullworksplugins.com/products/quick-event-manager/ )

Code Preview
php
<?php
add_filter('comments_open', function ($open, $post_id) {
    $post = get_post($post_id);
    if ($post->post_type == 'event') {
        return false;
    }
    return $open;
}, 10, 2);

Comments

Add a Comment