WordPressget_permalink()


Introduction

This function returns the full paralink of the current post or the designated post.

Syntax

  • get_permalink( $post, $leavename )

Parameters

ParameterDetails
$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.

Remarks

For the parameter $leavename, it is false by default.