Opened 5 weeks ago
Closed 3 weeks ago
#65192 closed enhancement (fixed)
Tests: Add unit tests for wp_admin_canonical_url()
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 7.1 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Administration | Keywords: | has-patch has-unit-tests |
| Focuses: | tests | Cc: |
Description
This ticket adds comprehensive unit tests for the wp_admin_canonical_url() function in wp-admin/includes/misc.php. The tests will cover the default URL generation, handling of query parameters, and the wp_admin_canonical_url filter.
Change History (4)
This ticket was mentioned in PR #11751 on WordPress/wordpress-develop by @pbearne.
5 weeks ago
#1
- Keywords has-patch has-unit-tests added
Note: See
TracTickets for help on using
tickets.
….php
Description:
This PR adds unit tests for the
wp_admin_canonical_url()function inwp-admin/includes/misc.php. These tests ensure that the function correctly identifies and removes single-use query parameters (such assettings-updated,trashed, etc.) from the administration URL to generate a clean canonical link.The tests cover:
wp_admin_canonical_urlfilter for custom canonical URLs.Trac ticket: https://core.trac.wordpress.org/ticket/65192
AI Disclosure: