How to display list of comment replies in user profile of current user

Question

i have a multi author website. How can i dispay list of comment replies in the user profile of current user. i can dispay user comments with this way. but i want to show only comment replies. please help. thanks for your attention

add_shortcode ( 'show_recent_comments', 'show_recent_comments_handler' );

function show_recent_comments_handler( $atts, $content = null )
{
    extract( shortcode_atts( array( 
        "count" => 20,
        "pretty_permalink" => 0
        ), $atts ));

    $output = ''; // this holds the output

    if ( is_user_logged_in() )
    {
    global $current_user;
    get_currentuserinfo();

    $args = array(
        'user_id' => $current_user->ID,
        'number' => $count, // how many comments to retrieve
        'status' => 'approve'
        );
    $comments = get_comments( $args );
    if ( $comments )
    {
        $output.= "<ul class='comcontainer'>n";
        foreach ( $comments as $c )
        {
        $output.= '<li class="comballs">';
        if ( $pretty_permalink ) // uses a lot more queries (not recommended)
            $output.= '<a href="'.get_comment_link( $c->comment_ID ).'">';
        else
        $output.= '</a><p>Şikayət: ' . get_the_title($c->comment_post_ID);
            $output.= '<span id="cm-txt"> <p>Şərh : </span><a href="'.get_settings('siteurl').'/?p='.$c->comment_post_ID.'#comment-'.$c->comment_ID.'">';         
        $output.= wp_trim_words($c->comment_content, 10, '...');
        
        $output.= "</li>n";
        }
        $output.= '</ul>';
        }
    }
    return $output;
}

<?php echo do_shortcode( '[show_recent_comments]' ); ?>
0
, , , Gidromasservis QSC 1 year 2020-07-12T05:10:46-05:00 0 Answers 67 views 0

Leave an answer

Browse
Browse