Core Function
View Source on Trac ↗ get_page_link()
get_page_link( mixed $post = false, mixed $leavename = false, mixed $sample = false ) Retrieves the permalink for the current page or page ID.
Parameters 2 required
| Name / Type | Description |
|---|---|
| (int | | WP_Post) $post Optional. Post ID or object. Default uses the global `$post`. Required |
| $leavename bool | Optional. Whether to keep the page name. Default false. |
| bool | $sample Optional. Whether it should be treated as a sample permalink. Default false. Required |
Return Value
(string)
The page permalink.
Function Information
Since Version
1.5.0
Source File
wp-includes/link-template.php
Advertisement