get_post_permalink

SummerySummery

Retrieves the permalink for a post of a custom post type.

Syntax

get_post_permalink( int|WP_Post $id, bool $leavename = false, bool $sample = false )

ParametersParameters

$id

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

$leavename

(bool) (Optional) defaults to false. Whether to keep post name.

Default value: false

$sample

(bool) (Optional) defaults to false. Is it a sample permalink.

Default value: false

ReturnReturn

(string|WP_Error) The post permalink.

SourceSource

File: wp-includes/link-template.php


			

ChangelogChangelog

Changelog
Version Description
3.0.0 Introduced.
Scroll to Top