Make WordPress Core


Ignore:
Timestamp:
03/11/2025 11:10:00 AM (2 months ago)
Author:
audrasjb
Message:

Permalinks: Ensure pagination links are consistent with permalink structure.

This changeset ensures that pagination links stay consistent with the chosen permalink structure. When the permalink structure uses a trailing slash, pagination permalinks contain one as well, but when the permalink structure doesn't use trailing slash, then pagination links should not use a trailing slash.

This makes use of user_trailingslashit() with a paged value for the type_of_url parameter.

Props hmbashar, huzaifaalmesbah, rejaulalomkhan, mai21, rahulsprajapati, martinkrcho, ankitkumarshah, adamsilverstein, sourabhjain.
Fixes #61393.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/general-template.php

    r59953 r59966  
    47144714        }
    47154715        $link .= $args['add_fragment'];
     4716        $link  = get_option( 'permalink_structure' ) ? user_trailingslashit( $link, 'paged' ) : $link;
    47164717
    47174718        $page_links[] = sprintf(
     
    47464747                }
    47474748                $link .= $args['add_fragment'];
     4749                $link  = get_option( 'permalink_structure' ) ? user_trailingslashit( $link, 'paged' ) : $link;
    47484750
    47494751                $page_links[] = sprintf(
     
    47704772        }
    47714773        $link .= $args['add_fragment'];
     4774        $link  = get_option( 'permalink_structure' ) ? user_trailingslashit( $link, 'paged' ) : $link;
    47724775
    47734776        $page_links[] = sprintf(
Note: See TracChangeset for help on using the changeset viewer.