get_the_ID(), 'type' => 'comment', 'count' => true ) ); $ping_count = get_comments( array( 'post_id' => get_the_ID(), 'type' => 'pingback', 'count' => true ) ); switch ( $type ) { case 'comment' : $count = $comment_count; $many = apply_filters( 'evolve_many_comments', __( '% Comments', 'evolve' ) ); $none = apply_filters( 'evolve_no_comments', __( 'No Comments Yet', 'evolve' ) ); $one = apply_filters( 'evolve_one_comment', __( '1 Comment', 'evolve' ) ); break; case 'pings' : $count = $ping_count; $many = apply_filters( 'evolve_many_pings', __( '% Pings/Trackbacks', 'evolve' ) ); $none = ''; $one = apply_filters( 'evolve_one_ping', __( '1 Ping/Trackback', 'evolve' ) ); break; } if ( $count > 1 ) { $number = str_replace( '%', number_format_i18n( $count ), $many ); } elseif ( $count == 1 ) { $number = $one; } else { if ( $type = 'comment' ) { $number = $none; } } $tag = apply_filters( 'evolve_discussion_title_tag', (string) 'h3' ); if ( $number ) { $discussion_title = '<' . $tag . ' class="' . $type . '-title mb-0">'; $discussion_title .= $number; $discussion_title .= ''; } $evolve_discussion_title = apply_filters( 'evolve_discussion_title', (string) $discussion_title ); return ( $echo ) ? print( $evolve_discussion_title ) : $evolve_discussion_title; } /* Comments Feed Link ======================================= */ function evolve_discussion_rss() { global $id; $uri = get_post_comments_feed_link( $id ); $text = '
' . evolve_get_svg( 'rss' ) . '
'; echo $text; } /* Custom Comment Navigation ======================================= */ function evolve_comment_navigation( $fragment_type ) { $page_list = paginate_comments_links( array( 'echo' => false, 'type' => 'array', 'prev_text' => __( 'Previous', 'evolve' ), 'next_text' => __( 'Next', 'evolve' ), 'add_fragment' => $fragment_type ) ); if ( ! is_array( $page_list ) ) { return; } $output = ''; foreach ( $page_list as $individual_page ) { $individual_page = "\n
  • $individual_page
  • \n"; $individual_page = str_replace( array( "page-numbers" ), array( "page-link" ), $individual_page ); $output .= $individual_page; } echo ''; } /* Default Comment Structure ======================================= */ function evolve_comments_callback( $comment, $args, $depth ) { global $post; if ( 'div' === $args['style'] ) { $tag = 'div'; $add_below = 'comment'; } else { $tag = 'li'; $add_below = 'div-comment'; } ?> < id="comment -">
    comment_ID ); $rating = intval( get_comment_meta( $comment->comment_ID, 'rating', true ) ); if ( $rating && 'yes' === get_option( 'woocommerce_enable_review_rating' ) ) { echo '
    ' . wc_get_rating_html( $rating ) . '
    '; } } ?> user_id === $post->post_author ) ? ' ' . __( 'Author', 'evolve' ) . '' : ''; echo ( get_comment_type() === "pingback" ) ? ' ' . __( 'Pingback', 'evolve' ) . '' : ''; echo ( class_exists( 'Woocommerce' ) && is_product() && 'yes' === get_option( 'woocommerce_review_rating_verification_label' ) && $verified ) ? ' ' . __( 'Verified buyer', 'evolve' ) . '' : ''; ?>
    ' . evolve_get_svg( 'pencil' ) . '', '
    ' ); if ( $args['avatar_size'] != 0 ) { echo '
    ' . get_avatar( $comment, $args['avatar_size'], '', '', array( 'class' => 'rounded-circle' ) ) . '
    '; } echo '
    '; ?>
    comment_approved == '0' ) { ?>
    $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); } if ( 'div' != $args['style'] ) : echo ''; endif; } /* Respond Form Fields ======================================= */ function evolve_comment_form_fields() { $evolve_commenter = wp_get_current_commenter(); $evolve_req = get_option( 'require_name_email' ); $evolve_aria_req = ( $evolve_req ? " aria-required='true'" : '' ); $fields = array( 'author' => '

    ' . '

    ', 'email' => '

    ' . '

    ', 'url' => '

    ' . '

    ', 'cookies' => '', ); return $fields; } add_filter( 'comment_form_default_fields', 'evolve_comment_form_fields' ); /* Comment Edit Link ======================================= */ function evolve_comment_edit() { edit_comment_link( '', '' . evolve_get_svg( 'pencil' ) . '', '' ); } /* Add Button Class To The Comment Reply Link ======================================= */ function evolve_replace_reply_link_class( $class ) { $class = str_replace( "class='comment-reply-link", "class='comment-reply-link btn btn-sm", $class ); return $class; } add_filter( 'comment_reply_link', 'evolve_replace_reply_link_class' ); /* Add Close Icon To The Cancel Reply Link ======================================= */ function evolve_cancel_reply_link( $formatted_link, $link, $text ) { $formatted_link = str_ireplace( $text, evolve_get_svg( 'close' ) . __( 'Cancel reply', 'evolve' ), $formatted_link ); return $formatted_link; } add_filter( 'cancel_comment_reply_link', 'evolve_cancel_reply_link', 10, 3 );