diff --git src/wp-includes/general-template.php src/wp-includes/general-template.php
index d521a64..2c7dea7 100644
|
|
function paginate_links( $args = '' ) { |
3783 | 3783 | |
3784 | 3784 | // Append the format placeholder to the base URL. |
3785 | 3785 | $pagenum_link = trailingslashit( $url_parts[0] ) . '%_%'; |
| 3786 | $pageone_link = $url_parts[0]; |
3786 | 3787 | |
3787 | 3788 | // URL base depends on permalink settings. |
3788 | 3789 | $format = $wp_rewrite->using_index_permalinks() && ! strpos( $pagenum_link, 'index.php' ) ? 'index.php/' : ''; |
… |
… |
function paginate_links( $args = '' ) { |
3873 | 3874 | $dots = true; |
3874 | 3875 | else : |
3875 | 3876 | if ( $args['show_all'] || ( $n <= $end_size || ( $current && $n >= $current - $mid_size && $n <= $current + $mid_size ) || $n > $total - $end_size ) ) : |
3876 | | $link = str_replace( '%_%', 1 == $n ? '' : $args['format'], $args['base'] ); |
3877 | | $link = str_replace( '%#%', $n, $link ); |
| 3877 | if ( $n == 1 ) { |
| 3878 | $link = str_replace( '%_%', '', $pageone_link ); |
| 3879 | } else { |
| 3880 | $link = str_replace( '%_%', 1 == $n ? '' : $args['format'], $args['base'] ); |
| 3881 | $link = str_replace( '%#%', $n, $link ); |
| 3882 | } |
3878 | 3883 | if ( $add_args ) { |
3879 | 3884 | $link = add_query_arg( $add_args, $link ); |
3880 | 3885 | } |
diff --git src/wp-includes/link-template.php src/wp-includes/link-template.php
index 815c539..ffa2083 100644
|
|
function get_pagenum_link( $pagenum = 1, $escape = true ) { |
2194 | 2194 | |
2195 | 2195 | $pagenum = (int) $pagenum; |
2196 | 2196 | |
2197 | | $request = remove_query_arg( 'paged' ); |
| 2197 | $request = false; |
| 2198 | |
| 2199 | if ( is_paged() ) { |
| 2200 | $object = get_queried_object(); |
| 2201 | |
| 2202 | if ( $object instanceof WP_Term ) { |
| 2203 | $request = get_term_link( $object ); |
| 2204 | } else if ( $object instanceof WP_Post ) { |
| 2205 | $request = get_permalink( $object ); |
| 2206 | } |
| 2207 | |
| 2208 | if ( $request ) { |
| 2209 | $request = str_replace( home_url(), '', $request ); |
| 2210 | } |
| 2211 | } |
| 2212 | |
| 2213 | if ( ! $request ) { |
| 2214 | $request = remove_query_arg( 'paged' ); |
| 2215 | } |
2198 | 2216 | |
2199 | 2217 | $home_root = parse_url( home_url() ); |
2200 | 2218 | $home_root = ( isset( $home_root['path'] ) ) ? $home_root['path'] : ''; |