Make WordPress Core

Ticket #54114: paginate_links.diff

File paginate_links.diff, 1.9 KB (added by Tkama, 3 years ago)
  • src/wp-includes/general-template.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/wp-includes/general-template.php b/src/wp-includes/general-template.php
    a b  
    41424142 *
    41434143 * @since 2.1.0
    41444144 * @since 4.9.0 Added the `aria_current` argument.
     4145 * @since 5.8.2 Added the `merge_query_vars` argument.
    41454146 *
    41464147 * @global WP_Query   $wp_query   WordPress Query object.
    41474148 * @global WP_Rewrite $wp_rewrite WordPress rewrite component.
     
    41694170 *     @type string $add_fragment       A string to append to each link. Default empty.
    41704171 *     @type string $before_page_number A string to appear before the page number. Default empty.
    41714172 *     @type string $after_page_number  A string to append after the page number. Default empty.
     4173 *     @type bool   $merge_query_vars   Whether to merge additional query vars found in the original URL into 'add_args' array. Default true.
    41724174 * }
    41734175 * @return string|array|void String of page links or array of page links, depending on 'type' argument.
    41744176 *                           Void if total number of pages is less than 2.
     
    42084210                'add_fragment'       => '',
    42094211                'before_page_number' => '',
    42104212                'after_page_number'  => '',
     4213                'merge_query_vars'   => true,
    42114214        );
    42124215
    42134216        $args = wp_parse_args( $args, $defaults );
     
    42174220        }
    42184221
    42194222        // Merge additional query vars found in the original URL into 'add_args' array.
    4220         if ( isset( $url_parts[1] ) ) {
     4223        if ( $args['merge_query_vars'] && isset( $url_parts[1] ) ) {
    42214224                // Find the format argument.
    42224225                $format       = explode( '?', str_replace( '%_%', $args['format'], $args['base'] ) );
    42234226                $format_query = isset( $format[1] ) ? $format[1] : '';