plugins – How to add comments to my custom post type but hide it from default WordPress Comments section?

Question

<?php
                    if (isset($_POST['submit_tickets'])){
                        $tickets_reply =  $_POST['tickets_reply'];
                        $faqpress_tickets_comment_data = array(
                            'comment_post_ID' => $post->ID,
                            'comment_content' => $tickets_reply,
                            'comment_author' => $current_user->display_name,
                            'comment_author_email' => $current_user->user_email,
                            'comment_type' => 'tickets_replies',
                            'user_id' => $current_user->ID,
                            'comment_date' => get_the_date(),
                            'comment_approved' => 1,
                        );

                        $commentid  = wp_insert_comment($faqpress_tickets_comment_data);
                    }
                    /*get replies*/

                    $args = array(

                        'user_id' => $current_user->ID,
                        'type' => 'tickets_replies'     
                    );
                    $get_tickets_replies = get_comments($args);

Now I want my comments only to be shown inside my Custom post type not in default WordPress comments section.

0
Rohit KC 2 weeks 2021-11-14T00:05:44-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse