get_the_permalink

Advertisement

Summery Summery

Retrieves the full permalink for the current post or post ID.

Syntax Syntax

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

Description Description

This function is an alias for get_permalink().

Parameters Parameters

$post

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

$leavename

(Optional) Whether to keep post name or page name.

Default value: false

Return Return

(string|false) The permalink URL or false if post does not exist.

Source Source

File: wp-includes/link-template.php

	return get_permalink( $post, $leavename );
}

Advertisement

Changelog Changelog

Changelog
Version Description
3.9.0 Introduced.

See also See also

Advertisement

Leave a Reply