For the parameter $leavename, it is false by default.
Code
echo get_permalink();
Output
The link of the current page, for example: http://website.com/category/name-of-post/
Code
echo get_permalink( 44 );
Output
The link of the post id:44, for example: http://website.com/category/name-of-post/
Code
echo get_permalink( 44 , false );
Output
The link of the post id:44 without the name of the post, for example: http://website.com/category/%postname%/
Parameter | Details |
---|---|
$post | (int) (optional) Post ID or post object. Default is the the current post's id. |
$leavename | (bool) (optional) Whether to keep post name or page name. |