get_permalink


get_permalink ( $post = 0, $leavename = false )

Parameters:
  • (int|WP_Post) $post Optional. Post ID or post object. Default is the global `$post`.
  • (bool) $leavename Optional. Whether to keep post name or page name. Default false.
Returns:
  • (string|false) The permalink URL or false if post does not exist.
Defined at:

Description

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

Related Functions

get_the_permalink, the_permalink, get_term_link, get_post_permalink, get_blog_permalink

Top Google Results

User discussions

wpseek mobile