get_page_link

SummerySummery

Retrieves the permalink for the current page or page ID.

Syntax

get_page_link( int|WP_Post $post = false, bool $leavename = false, bool $sample = false )

DescriptionDescription

Respects page_on_front. Use this one.

ParametersParameters

$post

(int|WP_Post) (Optional) Post ID or object. Default uses the global $post.

Default value: false

$leavename

(bool) (Optional) Whether to keep the page name.

Default value: false

$sample

(bool) (Optional) Whether it should be treated as a sample permalink.

Default value: false

ReturnReturn

(string) The page permalink.

SourceSource

File: wp-includes/link-template.php


			

ChangelogChangelog

Changelog
Version Description
1.5.0 Introduced.
Scroll to Top