Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Posts, Post Types: Don't force trailing slashes in get_pagenum_link(). #4801

Conversation

costdev
Copy link
Contributor

@costdev costdev commented Jul 6, 2023

Previously, a trailing slash was appended to the link returned from this function. If the permalink structure didn't contain a trailing slash, this link could fail.

This change removes trailing slashes and only appends one if the site is set for adding trailing slashes.


This PR is an update of #3931 which makes various test improvements, including:

  • Documentation updates.
  • Backing up $_SERVER['REQUEST_URI'] before any tests run, and restoring it after each test has run.
  • Using a data provider to group related datasets.
  • Adding datasets that account for index.php in the permalink structure.
  • Adding datasets that account for plain permalinks, date-based permalinks, and postname-based permalinks.
  • Adding a test that verifies that get_pagenum_link() adds a trailing slash when the permalink structure contains a trailing slash.

Trac ticket: https://core.trac.wordpress.org/ticket/2877

@costdev costdev changed the title Posts/Post Types: Don't force trailing slashes in get_pagenum_link(). Posts, Post Types: Don't force trailing slashes in get_pagenum_link(). Jul 6, 2023
@costdev costdev marked this pull request as ready for review July 6, 2023 02:25
@costdev costdev force-pushed the get_pagenum_link_do_not_add_trailing_slashes branch from f912d74 to 90032ee Compare July 6, 2023 02:31
@costdev costdev force-pushed the get_pagenum_link_do_not_add_trailing_slashes branch 3 times, most recently from 009b85f to 1ac0efc Compare July 7, 2023 00:58
@costdev costdev force-pushed the get_pagenum_link_do_not_add_trailing_slashes branch from 1ac0efc to e6af6c3 Compare October 15, 2023 23:08
@costdev
Copy link
Contributor Author

costdev commented Oct 16, 2023

Committed in r56939.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants