(int) $post_ID, 'orderby' => 'comment_date_gmt', 'order' => 'DESC', 'status' => 'approve', 'no_found_rows' => false, 'page' => '', 'per_page' => '', ); if ( 'desc' === get_option( 'comment_order' ) ) { $args['order'] = 'asc'; } if ( get_option( 'thread_comments' ) ) { $args['max_depth'] = get_option( 'thread_comments_depth' ); } else { $args['max_depth'] = -1; } if ( get_option( 'page_comments' ) === '1' || get_option( 'page_comments' ) === true ) { $per_page = (int) get_option( 'comments_per_page' ); $default_page = get_option( 'default_comments_page' ); if ( $per_page > 0 ) { $args['per_page'] = $per_page; $page = (int) get_query_var( 'cpage' ); if ( $page ) { $args['page'] = $page; $args['paged'] = $page; } elseif ( 'oldest' === $default_page ) { $args['page'] = 1; $args['paged'] = 1; } elseif ( 'newest' === $default_page ) { $max_comments_num = ( new WP_Comment_Query( array_merge( $args, array( 'number' => $per_page ) ) ) )->max_num_pages; $args['page'] = $max_comments_num; $args['paged'] = $max_comments_num; } // Set the `cpage` query var to ensure the previous and next pagination links are correct // when inheriting the Discussion Settings. if ( 0 === $page && isset( $args['paged'] ) && $args['paged'] > 0 ) { set_query_var( 'cpage', (int) $args['paged'] ); } } } return $args; } } if ( ! function_exists( 'qi_blocks_get_comments_list_template' ) ) { /** * Function which modify default WordPress comments list template * * @param object $comment * @param array $args * @param int $depth * * @return string that contains comments list html */ function qi_blocks_get_comments_list_template( $comment, $args, $depth ) { global $post; $classes = array(); $is_author_comment = $post->post_author === $comment->user_id; if ( $is_author_comment ) { $classes[] = 'qodef-comment--author'; } $is_specific_comment = 'pingback' === $comment->comment_type || 'trackback' === $comment->comment_type; if ( $is_specific_comment ) { $classes[] = 'qodef-comment--no-avatar'; $classes[] = 'qodef-comment--' . esc_attr( $comment->comment_type ); } ?>
%s %s
', '', '' ), 'submit_button' => '', 'class_submit' => implode( ' ', $classes ), 'class_form' => 'qodef-comment-form', ); return apply_filters( 'qi_blocks_filter_comment_form_args', $args ); } }
%s%s', esc_attr( $is_specific_comment ) ? sprintf( '%s: ', esc_attr( ucwords( $comment->comment_type ) ) ) : '', get_comment_author_link() ); ?>