'', 'mid_size' => 2, 'prev_text' => '', 'next_text' => '', 'screen_reader_text' => __( 'Posts navigation', 'ayecode-connect' ), 'before_paging' => '', 'after_paging' => '', 'type' => 'array', 'total' => isset( $wp_query->max_num_pages ) ? $wp_query->max_num_pages : 1, 'links' => array(), // an array of links if using custom links, this includes the a tag. 'rounded_style' => false, 'custom_next_text' => '', // Custom next page text 'custom_prev_text' => '', // Custom prev page text ); /** * Parse incoming $args into an array and merge it with $defaults */ $args = wp_parse_args( $args, $defaults ); $output = ''; // Don't print empty markup if there's only one page. if ( $args['total'] > 1 ) { // Set up paginated links. $links = !empty( $args['links'] ) ? $args['links'] : paginate_links( $args ); $class = !empty($args['class']) ? $args['class'] : ''; $custom_prev_link = ''; $custom_next_link = ''; // make the output bootstrap ready $links_html = ""; if ( $links ) { $output .= '
'; $output .= _navigation_markup( $links_html, 'aui-pagination', $args['screen_reader_text'] ); $output .= '
'; } $output = str_replace( "screen-reader-text", "screen-reader-text sr-only" . ( $aui_bs5 ? ' visually-hidden' : '' ), $output ); $output = str_replace( "nav-links", "aui-nav-links", $output ); } if ( $output ) { if ( $custom_next_link || $custom_prev_link ) { $total = isset( $wp_query->max_num_pages ) ? $wp_query->max_num_pages : 1; $current = get_query_var( 'paged' ) ? (int) get_query_var( 'paged' ) : 1; $output = '
' . $custom_prev_link . '
' . $output . '
' . $current . '/' . $args['total'] . '
' . $custom_next_link . '
'; } if ( ! empty( $args['before_paging'] ) ) { $output = $args['before_paging'] . $output; } if ( ! empty( $args['after_paging'] ) ) { $output = $output . $args['after_paging']; } } return $output; } }