HEX
Server: LiteSpeed
System: Linux pbn-10.isgood.host 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64
User: pg88zccom (1239)
PHP: 8.1.32
Disabled: NONE
Upload Files
File: /usr/local/lsws/pg88zc.com/html/wp-content/themes/flatsome-child/includes/disable-comment.php
<?php
if (!class_exists('disable_comments') {
    class disable_comments {

        public function __construct() {
            add_action('admin_init', array($this, 'disable_comments_on_all_post_types'));
            add_filter('comments_open', array($this, 'disable_comments_status'), 20, 2);
            add_filter('pings_open', array($this, 'disable_comments_status'), 20, 2);
        }

        public function disable_comments_on_all_post_types() {
            $types = get_post_types();
            foreach ($types as $type) {
                if (post_type_supports($type, 'comments')) {
                    remove_post_type_support($type, 'comments');
                    remove_post_type_support($type, 'trackbacks');
                }
            }
        }

        public function disable_comments_status() {
            return false;
        }
    }

    new disable_comments();
}