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 .= '' . $tag . '>'; } $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 = '
'; 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' . '
', '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 );