esc_html_x( '«', 'Pagination text (visible): previous.', 'michelle' ) . ' ' . esc_html_x( 'Previous page', 'Pagination text (hidden): previous.', 'michelle' ) . '', 'next_text' => '' . esc_html_x( 'Next page', 'Pagination text (hidden): next.', 'michelle' ) . ' ' . esc_html_x( '»', 'Pagination text (visible): next.', 'michelle' ), ), 'loop' ); $pagination = paginate_links( $args ); // Processing if ( $pagination ) { $total = ( isset( $GLOBALS['wp_query']->max_num_pages ) ) ? ( $GLOBALS['wp_query']->max_num_pages ) : ( 1 ); $current = absint( max( get_query_var( 'paged' ), 1 ) ); $pagination = ''; } // Output echo $pagination; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } // /posts /** * Comments pagination. * * From simple next/previous links to full pagination. * * @since 1.0.0 * * @param string $template The default template. * @param string $class The class passed by the calling function. * * @return string */ public static function comments( string $template, string $class ): string { // Requirements check if ( 'comment-navigation' !== $class ) { return $template; } // Variables $args = self::get_args_filtered( array( 'prev_text' => esc_html_x( '«', 'Pagination text (visible): previous.', 'michelle' ) . ' ' . esc_html_x( 'Previous page', 'Pagination text (hidden): previous.', 'michelle' ) . '', 'next_text' => '' . esc_html_x( 'Next page', 'Pagination text (hidden): next.', 'michelle' ) . ' ' . esc_html_x( '»', 'Pagination text (visible): next.', 'michelle' ), ), 'comments' ); $pagination = paginate_comments_links( array_merge( $args, array( 'echo' => false ) ) ); $total = get_comment_pages_count(); $current = ( get_query_var( 'cpage' ) ) ? ( absint( get_query_var( 'cpage' ) ) ) : ( 1 ); // Processing // Modifying navigation wrapper classes. $template = str_replace( '