WordPress get_permalink()

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

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.



Got any WordPress Question?