Core Function
View Source on Trac ↗ redirect_canonical()
redirect_canonical( mixed $requested_url = null, mixed $do_redirect = true ) Redirects incoming links to the proper URL based on the site url.
Parameters 1 required
| Name / Type | Description |
|---|---|
| string | $requested_url Optional. The URL that was requested, used to figure if redirect is needed. Required |
| $do_redirect bool | Optional. Redirect to the new URL. |
Return Value
((string)
| void) The string of the URL, if redirect needed.
Function Information
Since Version
2.3.0
Source File
wp-includes/canonical.php
Advertisement