get_the_permalink( int|WP_Post $post, bool $leavename = false )
Retrieves the full permalink for the current post or post ID.
Contents
Description Description
This function is an alias for get_permalink().
See also See also
Parameters 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 value: false
Return Return
(string|false) The permalink URL or false if post does not exist.
Source Source
File: wp-includes/link-template.php
function get_the_permalink( $post = 0, $leavename = false ) { return get_permalink( $post, $leavename ); }
Expand full source code Collapse full source code View on Trac
Changelog Changelog
Version | Description |
---|---|
3.9.0 | Introduced. |