How to get current page URL regardless of permalink settings
-
I’m familiar with get_permalink() to get the permalink URL, but I need to get the URL of the page regardless of the user having permalink settings or not. In other words, if they have the ‘default’ permalink settings, I would like that URL.
For example, suppose I have a page whose ID is 12345. The permalink URL might look something like this:
https://www.domain.com/some_page/
The ‘default’ URL might look like this:
https://www.domain.com/?page_id=12345.
Is there a WP specific function to obtain this URL? I’m familiar with $_SERVER[‘REQUEST_URI’] and $_SERVER[‘PHP_SELF’] , but was hoping for something WP specific.
Thanks
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘How to get current page URL regardless of permalink settings’ is closed to new replies.