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

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


Description

This function is an alias for get_permalink() .

Top ↑

See also


Top ↑

Parameters

$post int|WP_Post Optional
Post ID or post object. Default is the global $post.
$leavename bool Optional
Whether to keep post name or page name.

Default: false


Top ↑

Return

string|false The permalink URL. False if the post does not exist.


Top ↑

Source

File: wp-includes/link-template.php. View all references

function get_the_permalink( $post = 0, $leavename = false ) {
	return get_permalink( $post, $leavename );
}


Top ↑

Changelog

Changelog
Version Description
3.9.0 Introduced.

Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.