[wp-trac] [WordPress Trac] #2877: A Slash too much @ get_pagenum_link()
WordPress Trac
noreply at wordpress.org
Fri Feb 3 19:16:59 UTC 2023
#2877: A Slash too much @ get_pagenum_link()
-------------------------------------------------+-------------------------
Reporter: dave@… | Owner: petitphp
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: Future
| Release
Component: Posts, Post Types | Version: 2.0
Severity: normal | Resolution:
Keywords: has-patch needs-testing has-unit- | Focuses: template
tests |
-------------------------------------------------+-------------------------
Comment (by petitphp):
PR with refreshed patch added.
I've made a change from the original patch to ensure query_args don't
force a trailing slash, and I updated the tests accordingly.
I've tested multiple cases :
* **single site install** with permalink structure
`/%category%/%postname%/` (trailing slash)
* link to first page : https://example.com/category/nam-voluptas/
* link to second page : https://example.com/category/nam-voluptas/page/2/
* **single site install** with permalink structure
`/%category%/%postname%` (no trailing slash)
* link to first page : https://example.com/category/officiis-incidunt
* link to second page : https://example.com/category/officiis-
incidunt/page/2
* **multisite subdirectory install** with permalink structure
`/%category%/%postname%`
* link to first page : https://example.com/site-one/category/quia-
voluptatem
* link to second page : https://example.com/site-one/category/quia-
voluptatem/page/2
* **multisite subdomain install** with permalink structure
`/%category%/%postname%`
* link to first page : https://site-one.example.com/category/quasi
* link to second page : https://site-
one.example.com/category/quasi/page/2
In every case, `get_pagenum_link` correctly matched the permalink
structure and only added a trailing slash if present.
This should be ready for testing on more exotic WordPress install.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/2877#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list