Codex

Attention Help us to improve the Codex by filling out our documentation survey!

Function Reference/get post permalink

Contents

Description

The get_post_permalink template tag retrieves the permalink for a post with a custom post type.

Usage

<?php get_post_permalink$id$leavename$sample ); ?>

Default Usage

<?php get_post_permalink(); ?>

Parameters

id
(integer) (optional) Post ID.
Default: 0
leavename
(boolean) (optional) Whether to keep post name.
Default: false
sample
(boolean) (optional) Is it a sample permalink.
Default: false

Return

(string)

Hooks

apply_filters() Calls 'post_type_link' hook

Examples

Changelog

  • 3.0.0 : New template tag.

Source Code

get_post_permalink() is located in wp-includes/link-template.php.

Related

Edit Link: edit_post_link(), edit_comment_link(), edit_tag_link(), edit_bookmark_link()

See also index of Function Reference and index of Template Tags.
This page is marked as incomplete. You can help Codex by expanding it.